1 /* 2 * Copyright (C) 2018 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.server.testing.shadows; 18 19 import android.util.Log; 20 import android.util.Slog; 21 22 import org.robolectric.annotation.Implementation; 23 import org.robolectric.annotation.Implements; 24 25 @Implements(Slog.class) 26 public class ShadowSlog { 27 @Implementation v(String tag, String msg)28 protected static int v(String tag, String msg) { 29 return Log.v(tag, msg); 30 } 31 32 @Implementation v(String tag, String msg, Throwable tr)33 protected static int v(String tag, String msg, Throwable tr) { 34 return Log.v(tag, msg, tr); 35 } 36 37 @Implementation d(String tag, String msg)38 protected static int d(String tag, String msg) { 39 return Log.d(tag, msg); 40 } 41 42 @Implementation d(String tag, String msg, Throwable tr)43 protected static int d(String tag, String msg, Throwable tr) { 44 return Log.d(tag, msg, tr); 45 } 46 47 @Implementation i(String tag, String msg)48 protected static int i(String tag, String msg) { 49 return Log.i(tag, msg); 50 } 51 52 @Implementation i(String tag, String msg, Throwable tr)53 protected static int i(String tag, String msg, Throwable tr) { 54 return Log.i(tag, msg, tr); 55 } 56 57 @Implementation w(String tag, String msg)58 protected static int w(String tag, String msg) { 59 return Log.w(tag, msg); 60 } 61 62 @Implementation w(String tag, String msg, Throwable tr)63 protected static int w(String tag, String msg, Throwable tr) { 64 return Log.w(tag, msg, tr); 65 } 66 67 @Implementation w(String tag, Throwable tr)68 protected static int w(String tag, Throwable tr) { 69 return Log.w(tag, tr); 70 } 71 72 @Implementation e(String tag, String msg)73 protected static int e(String tag, String msg) { 74 return Log.e(tag, msg); 75 } 76 77 @Implementation e(String tag, String msg, Throwable tr)78 protected static int e(String tag, String msg, Throwable tr) { 79 return Log.e(tag, msg, tr); 80 } 81 82 @Implementation wtf(String tag, String msg)83 protected static int wtf(String tag, String msg) { 84 return Log.wtf(tag, msg); 85 } 86 87 @Implementation wtfQuiet(String tag, String msg)88 protected static void wtfQuiet(String tag, String msg) { 89 Log.wtf(tag, msg); 90 } 91 92 @Implementation wtfStack(String tag, String msg)93 protected static int wtfStack(String tag, String msg) { 94 return Log.wtf(tag, msg); 95 } 96 97 @Implementation wtf(String tag, Throwable tr)98 protected static int wtf(String tag, Throwable tr) { 99 return Log.wtf(tag, tr); 100 } 101 102 @Implementation wtf(String tag, String msg, Throwable tr)103 protected static int wtf(String tag, String msg, Throwable tr) { 104 return Log.wtf(tag, msg, tr); 105 } 106 107 @Implementation println(int priority, String tag, String msg)108 protected static int println(int priority, String tag, String msg) { 109 return Log.println(priority, tag, msg); 110 } 111 } 112