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_HAL = "CAR.HAL"; 30 public static final String TAG_HVAC = "CAR.HVAC"; 31 public static final String TAG_VENDOR_EXT = "CAR.VENDOR_EXT"; 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_PACKAGE = "CAR.PACKAGE"; 38 public static final String TAG_POWER = "CAR.POWER"; 39 public static final String TAG_PROJECTION = "CAR.PROJECTION"; 40 public static final String TAG_PROPERTY = "CAR.PROPERTY"; 41 public static final String TAG_SENSOR = "CAR.SENSOR"; 42 public static final String TAG_SERVICE = "CAR.SERVICE"; 43 public static final String TAG_SYS = "CAR.SYS"; 44 public static final String TAG_TEST = "CAR.TEST"; 45 public static final String TAG_DIAGNOSTIC = "CAR.DIAGNOSTIC"; 46 public static final String TAG_STORAGE = "CAR.STORAGE"; 47 concatTag(String tagPrefix, Class clazz)48 public static String concatTag(String tagPrefix, Class clazz) { 49 String tag = tagPrefix + "." + clazz.getSimpleName(); 50 if (tag.length() > MAX_TAG_LEN) { 51 tag = tag.substring(0, MAX_TAG_LEN); 52 } 53 return tag; 54 } 55 } 56