1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
5  * except in compliance with the License. You may obtain a copy of the License at
6  *
7  *      http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the
10  * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11  * KIND, either express or implied. See the License for the specific language governing
12  * permissions and limitations under the License.
13  */
14 
15 package com.android.systemui.plugins.log
16 
17 /**
18  * Base interface for a logger that logs changes in table format.
19  *
20  * This is a plugin interface for classes outside of SystemUI core.
21  */
22 interface TableLogBufferBase {
23     /**
24      * Logs a String? change.
25      *
26      * For Java overloading.
27      */
28     fun logChange(prefix: String, columnName: String, value: String?) {
29         logChange(prefix, columnName, value, isInitial = false)
30     }
31 
32     /** Logs a String? change. */
33     fun logChange(prefix: String, columnName: String, value: String?, isInitial: Boolean)
34 
35     /**
36      * Logs a Boolean change.
37      *
38      * For Java overloading.
39      */
40     fun logChange(prefix: String, columnName: String, value: Boolean) {
41         logChange(prefix, columnName, value, isInitial = false)
42     }
43 
44     /** Logs a Boolean change. */
45     fun logChange(prefix: String, columnName: String, value: Boolean, isInitial: Boolean)
46 
47     /**
48      * Logs an Int? change.
49      *
50      * For Java overloading.
51      */
52     fun logChange(prefix: String, columnName: String, value: Int?) {
53         logChange(prefix, columnName, value, isInitial = false)
54     }
55 
56     /** Logs an Int? change. */
57     fun logChange(prefix: String, columnName: String, value: Int?, isInitial: Boolean)
58 }
59