1 /*
2  * Copyright (C) 2012 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 android.telephony;
18 
19 import android.util.Log;
20 
21 /**
22  * A class to log strings to the RADIO LOG.
23  *
24  * @hide
25  */
26 public final class Rlog {
27 
Rlog()28     private Rlog() {
29     }
30 
v(String tag, String msg)31     public static int v(String tag, String msg) {
32         return Log.println_native(Log.LOG_ID_RADIO, Log.VERBOSE, tag, msg);
33     }
34 
v(String tag, String msg, Throwable tr)35     public static int v(String tag, String msg, Throwable tr) {
36         return Log.println_native(Log.LOG_ID_RADIO, Log.VERBOSE, tag,
37                 msg + '\n' + Log.getStackTraceString(tr));
38     }
39 
d(String tag, String msg)40     public static int d(String tag, String msg) {
41         return Log.println_native(Log.LOG_ID_RADIO, Log.DEBUG, tag, msg);
42     }
43 
d(String tag, String msg, Throwable tr)44     public static int d(String tag, String msg, Throwable tr) {
45         return Log.println_native(Log.LOG_ID_RADIO, Log.DEBUG, tag,
46                 msg + '\n' + Log.getStackTraceString(tr));
47     }
48 
i(String tag, String msg)49     public static int i(String tag, String msg) {
50         return Log.println_native(Log.LOG_ID_RADIO, Log.INFO, tag, msg);
51     }
52 
i(String tag, String msg, Throwable tr)53     public static int i(String tag, String msg, Throwable tr) {
54         return Log.println_native(Log.LOG_ID_RADIO, Log.INFO, tag,
55                 msg + '\n' + Log.getStackTraceString(tr));
56     }
57 
w(String tag, String msg)58     public static int w(String tag, String msg) {
59         return Log.println_native(Log.LOG_ID_RADIO, Log.WARN, tag, msg);
60     }
61 
w(String tag, String msg, Throwable tr)62     public static int w(String tag, String msg, Throwable tr) {
63         return Log.println_native(Log.LOG_ID_RADIO, Log.WARN, tag,
64                 msg + '\n' + Log.getStackTraceString(tr));
65     }
66 
w(String tag, Throwable tr)67     public static int w(String tag, Throwable tr) {
68         return Log.println_native(Log.LOG_ID_RADIO, Log.WARN, tag, Log.getStackTraceString(tr));
69     }
70 
e(String tag, String msg)71     public static int e(String tag, String msg) {
72         return Log.println_native(Log.LOG_ID_RADIO, Log.ERROR, tag, msg);
73     }
74 
e(String tag, String msg, Throwable tr)75     public static int e(String tag, String msg, Throwable tr) {
76         return Log.println_native(Log.LOG_ID_RADIO, Log.ERROR, tag,
77                 msg + '\n' + Log.getStackTraceString(tr));
78     }
79 
println(int priority, String tag, String msg)80     public static int println(int priority, String tag, String msg) {
81         return Log.println_native(Log.LOG_ID_RADIO, priority, tag, msg);
82     }
83 
isLoggable(String tag, int level)84     public static boolean isLoggable(String tag, int level) {
85         return Log.isLoggable(tag, level);
86     }
87 
88 }
89 
90