1 /*
2  * Copyright (C) 2007 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.telephony.cat;
18 
19 import android.compat.annotation.UnsupportedAppUsage;
20 import android.os.Build;
21 
22 import com.android.telephony.Rlog;
23 
24 public abstract class CatLog {
25     static final boolean DEBUG = true;
26 
27     @UnsupportedAppUsage
d(Object caller, String msg)28     public static void d(Object caller, String msg) {
29         if (!DEBUG) {
30             return;
31         }
32 
33         String className = caller.getClass().getName();
34         Rlog.d("CAT", className.substring(className.lastIndexOf('.') + 1) + ": "
35                 + msg);
36     }
37 
38     @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
d(String caller, String msg)39     public static void d(String caller, String msg) {
40         if (!DEBUG) {
41             return;
42         }
43 
44         Rlog.d("CAT", caller + ": " + msg);
45     }
46     @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
e(Object caller, String msg)47     public static void e(Object caller, String msg) {
48         String className = caller.getClass().getName();
49         Rlog.e("CAT", className.substring(className.lastIndexOf('.') + 1) + ": "
50                 + msg);
51     }
52 
e(String caller, String msg)53     public static void e(String caller, String msg) {
54         Rlog.e("CAT", caller + ": " + msg);
55     }
56 }
57