21
21
/**
22
22
* Created by Will on 7/20/16.
23
23
*/
24
- @ SuppressWarnings ({"checkstyle:methodname" , "checkstyle:javadocmethod" })
24
+ @ SuppressWarnings ({ "checkstyle:methodname" , "checkstyle:javadocmethod" })
25
25
public class Log {
26
26
27
27
private static Logger logger ;
@@ -34,17 +34,18 @@ private static Logger getInstance() {
34
34
return logger ;
35
35
}
36
36
37
- //Do not call this while logging from a different thread...
38
- //That's asking for trouble...
37
+ // Do not call this while logging from a different thread...
38
+ // That's asking for trouble...
39
39
public static void setInstance (Logger logger ) {
40
40
Log .logger = logger ;
41
41
}
42
42
43
43
/**
44
- * Sets the level of the Logger. For example, if the level is Error,
45
- * all ERROR and ASSERT messages will be logged, but nothing else.
44
+ * Sets the level of the Logger. For example, if the level is Error, all
45
+ * ERROR and ASSERT messages will be logged, but nothing else.
46
46
*
47
- * @param level the level to log at
47
+ * @param level
48
+ * the level to log at
48
49
*/
49
50
public static void setLevel (Level level ) {
50
51
Log .level = level ;
@@ -136,12 +137,14 @@ public static void wtf(String tag, String msg, Throwable tr) {
136
137
137
138
public enum Level {
138
139
140
+ ALL (Integer .MIN_VALUE ),
139
141
VERBOSE (2 ),
140
142
DEBUG (3 ),
141
143
INFO (4 ),
142
144
WARN (5 ),
143
145
ERROR (6 ),
144
- ASSERT (7 );
146
+ ASSERT (7 ),
147
+ NONE (Integer .MAX_VALUE );
145
148
146
149
private int level ;
147
150
@@ -164,7 +167,7 @@ public void log(Level level, String tag, String msg, Throwable tr) {
164
167
PrintWriter printWriter = new PrintWriter (sw );
165
168
tr .printStackTrace (printWriter );
166
169
body += "\n " + sw .toString ();
167
- //No need to close. No resources taken up
170
+ // No need to close. No resources taken up
168
171
}
169
172
String result = String .format ("%s/%s: %s" , prefix , tag , body );
170
173
System .out .println (result );
0 commit comments