1 /* 2 * Copyright (C) 2024 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.annotation.NonNull; 20 21 /** 22 * Interface for logging backends to provide persistent log storage. 23 * 24 * @hide 25 */ 26 public interface PersistentLoggerBackend { 27 28 /** 29 * Persist a DEBUG log message. 30 * @param tag Used to identify the source of a log message. 31 * @param msg The message you would like logged. 32 */ debug(@onNull String tag, @NonNull String msg)33 void debug(@NonNull String tag, @NonNull String msg); 34 35 /** 36 * Persist a INFO log message. 37 * @param tag Used to identify the source of a log message. 38 * @param msg The message you would like logged. 39 */ info(@onNull String tag, @NonNull String msg)40 void info(@NonNull String tag, @NonNull String msg); 41 42 /** 43 * Persist a WARN log message. 44 * @param tag Used to identify the source of a log message. 45 * @param msg The message you would like logged. 46 */ warn(@onNull String tag, @NonNull String msg)47 void warn(@NonNull String tag, @NonNull String msg); 48 49 /** 50 * Persist a WARN log message. 51 * @param tag Used to identify the source of a log message. 52 * @param msg The message you would like logged. 53 * @param t An exception to log. 54 */ warn(@onNull String tag, @NonNull String msg, @NonNull Throwable t)55 void warn(@NonNull String tag, @NonNull String msg, @NonNull Throwable t); 56 57 /** 58 * Persist a ERROR log message. 59 * @param tag Used to identify the source of a log message. 60 * @param msg The message you would like logged. 61 */ error(@onNull String tag, @NonNull String msg)62 void error(@NonNull String tag, @NonNull String msg); 63 64 /** 65 * Persist a ERROR log message. 66 * @param tag Used to identify the source of a log message. 67 * @param msg The message you would like logged. 68 * @param t An exception to log. 69 */ error(@onNull String tag, @NonNull String msg, @NonNull Throwable t)70 void error(@NonNull String tag, @NonNull String msg, @NonNull Throwable t); 71 } 72