1 /*
2  * Copyright (C) 2015 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.car;
18 
19 public class CarLog {
20     private static final int MAX_TAG_LEN = 23;
21 
22     public static final String TAG_AM = "CAR.AM";
23     public static final String TAG_APP_FOCUS = "CAR.APP_FOCUS";
24     public static final String TAG_AUDIO = "CAR.AUDIO";
25     public static final String TAG_CABIN = "CAR.CABIN";
26     public static final String TAG_CAMERA = "CAR.CAMERA";
27     public static final String TAG_CAN_BUS = "CAR.CAN_BUS";
28     public static final String TAG_CLUSTER = "CAR.CLUSTER";
29     public static final String TAG_DIAGNOSTIC = "CAR.DIAGNOSTIC";
30     public static final String TAG_HAL = "CAR.HAL";
31     public static final String TAG_HVAC = "CAR.HVAC";
32     public static final String TAG_INFO = "CAR.INFO";
33     public static final String TAG_INPUT = "CAR.INPUT";
34     public static final String TAG_MEDIA = "CAR.MEDIA";
35     public static final String TAG_MONITORING = "CAR.MONITORING";
36     public static final String TAG_NAV = "CAR.NAV";
37     public static final String TAG_OCCUPANT = "CAR.OCCUPANT";
38     public static final String TAG_OAS = "CAR.OAS";
39     public static final String TAG_PACKAGE = "CAR.PACKAGE";
40     public static final String TAG_POWER = "CAR.POWER";
41     public static final String TAG_PROJECTION = "CAR.PROJECTION";
42     public static final String TAG_PROPERTY = "CAR.PROPERTY";
43     public static final String TAG_SENSOR = "CAR.SENSOR";
44     public static final String TAG_SERVICE = "CAR.SERVICE";
45     public static final String TAG_STORAGE = "CAR.STORAGE";
46     public static final String TAG_SYS = "CAR.SYS";
47     public static final String TAG_TEST = "CAR.TEST";
48     public static final String TAG_USER = "CAR.USER";
49     public static final String TAG_VENDOR_EXT = "CAR.VENDOR_EXT";
50     public static final String TAG_WATCHDOG = "CAR.WATCHDOG";
51 
concatTag(String tagPrefix, Class clazz)52     public static String concatTag(String tagPrefix, Class clazz) {
53         String tag = tagPrefix + "." + clazz.getSimpleName();
54         if (tag.length() > MAX_TAG_LEN) {
55             tag = tag.substring(0, MAX_TAG_LEN);
56         }
57         return tag;
58     }
59 }
60