1 /*
2  * Copyright (C) 2010 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 vogar.util;
18 
19 import java.util.List;
20 
21 public class Log {
22 
23     private static LogOutput sLogoutput = null;
24 
setOutput(LogOutput logOutput)25     public static void setOutput(LogOutput logOutput) {
26         sLogoutput = logOutput;
27     }
28 
verbose(String s)29     public static void verbose(String s) {
30         if (sLogoutput != null) {
31             sLogoutput.verbose(s);
32         }
33     }
34 
warn(String message)35     public static void warn(String message) {
36         if (sLogoutput != null) {
37             sLogoutput.warn(message);
38         }
39     }
40 
41     /**
42      * Warns, and also puts a list of strings afterwards.
43      */
warn(String message, List<String> list)44     public static void warn(String message, List<String> list) {
45         if (sLogoutput != null) {
46             sLogoutput.warn(message, list);
47         }
48     }
49 
info(String s)50     public static void info(String s) {
51         if (sLogoutput != null) {
52             sLogoutput.info(s);
53         }
54     }
55 
info(String message, Throwable throwable)56     public static void info(String message, Throwable throwable) {
57         if (sLogoutput != null) {
58             sLogoutput.info(message, throwable);
59         }
60     }
61 
nativeOutput(String outputLine)62     public static void nativeOutput(String outputLine) {
63         if (sLogoutput != null) {
64             sLogoutput.nativeOutput(outputLine);
65         }
66 
67     }
68 }
69