Skip to content

Commit e076965

Browse files
sadyeGrover-c13
authored andcommitted
Extra log levels: all and none (#409)
* Extra log levels: all and none * Fix indentation (tabs only)
1 parent 9717bc2 commit e076965

File tree

1 file changed

+11
-8
lines changed
  • src/main/java/com/pokegoapi/util

1 file changed

+11
-8
lines changed

src/main/java/com/pokegoapi/util/Log.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Created by Will on 7/20/16.
2323
*/
24-
@SuppressWarnings({"checkstyle:methodname", "checkstyle:javadocmethod"})
24+
@SuppressWarnings({ "checkstyle:methodname", "checkstyle:javadocmethod" })
2525
public class Log {
2626

2727
private static Logger logger;
@@ -34,17 +34,18 @@ private static Logger getInstance() {
3434
return logger;
3535
}
3636

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...
3939
public static void setInstance(Logger logger) {
4040
Log.logger = logger;
4141
}
4242

4343
/**
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.
4646
*
47-
* @param level the level to log at
47+
* @param level
48+
* the level to log at
4849
*/
4950
public static void setLevel(Level level) {
5051
Log.level = level;
@@ -136,12 +137,14 @@ public static void wtf(String tag, String msg, Throwable tr) {
136137

137138
public enum Level {
138139

140+
ALL(Integer.MIN_VALUE),
139141
VERBOSE(2),
140142
DEBUG(3),
141143
INFO(4),
142144
WARN(5),
143145
ERROR(6),
144-
ASSERT(7);
146+
ASSERT(7),
147+
NONE(Integer.MAX_VALUE);
145148

146149
private int level;
147150

@@ -164,7 +167,7 @@ public void log(Level level, String tag, String msg, Throwable tr) {
164167
PrintWriter printWriter = new PrintWriter(sw);
165168
tr.printStackTrace(printWriter);
166169
body += "\n" + sw.toString();
167-
//No need to close. No resources taken up
170+
// No need to close. No resources taken up
168171
}
169172
String result = String.format("%s/%s: %s", prefix, tag, body);
170173
System.out.println(result);

0 commit comments

Comments
 (0)