• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.internal.protolog.common;
18 
19 /**
20  * Defines a log group configuration object for ProtoLog. Should be implemented as en enum.
21  */
22 public interface IProtoLogGroup {
23     /**
24      * if false all log statements for this group are excluded from compilation,
25      */
isEnabled()26     boolean isEnabled();
27 
28     /**
29      * @deprecated TODO(b/324128613) remove once we migrate fully to Perfetto
30      * is binary logging enabled for the group.
31      */
isLogToProto()32     boolean isLogToProto();
33 
34     /**
35      * is text logging enabled for the group.
36      */
isLogToLogcat()37     boolean isLogToLogcat();
38 
39     /**
40      * returns true is any logging is enabled for this group.
41      * @deprecated TODO(b/324128613) remove once we migrate fully to Perfetto
42      */
isLogToAny()43     default boolean isLogToAny() {
44         return isLogToLogcat() || isLogToProto();
45     }
46 
47     /**
48      * returns the name of the source of the logged message
49      */
getTag()50     String getTag();
51 
52     /**
53      * set binary logging for this group.
54      * @deprecated TODO(b/324128613) remove once we migrate fully to Perfetto
55      */
setLogToProto(boolean logToProto)56     void setLogToProto(boolean logToProto);
57 
58     /**
59      * set text logging for this group.
60      */
setLogToLogcat(boolean logToLogcat)61     void setLogToLogcat(boolean logToLogcat);
62 
63     /**
64      * returns name of the logging group.
65      */
name()66     String name();
67 
68     /**
69      * returns the id of the logging group (unique for each group).
70      */
getId()71     int getId();
72 }
73