-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZIPLogger.java
More file actions
44 lines (32 loc) · 1.21 KB
/
ZIPLogger.java
File metadata and controls
44 lines (32 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package dev.imprex.zip.common;
import java.util.logging.Level;
import java.util.logging.Logger;
public class ZIPLogger {
private static Logger logger = Logger.getLogger("bukkit.zeroinventoryproblems");
private static final String LOG_PREFIX = "[ZeroInventoryProblems] ";
private static final String LOG_DEBUG_PREFIX = "[ZeroInventoryProblems/Debug] ";
private static boolean verbose = false;
public static void setVerbose(boolean verbose) {
ZIPLogger.verbose = verbose;
}
public static void log(Level level, String message) {
ZIPLogger.logger.log(level, LOG_PREFIX + message);
}
public static void debug(String message) {
if (ZIPLogger.verbose) {
ZIPLogger.logger.log(Level.FINE, LOG_DEBUG_PREFIX + message);
}
}
public static void info(String message) {
ZIPLogger.logger.log(Level.INFO, LOG_PREFIX + message);
}
public static void warn(String message) {
ZIPLogger.logger.log(Level.WARNING, LOG_PREFIX + message);
}
public static void warn(String message, Throwable throwable) {
ZIPLogger.logger.log(Level.WARNING, LOG_PREFIX + message, throwable);
}
public static void error(String message, Throwable throwable) {
ZIPLogger.logger.log(Level.SEVERE, LOG_PREFIX + message, throwable);
}
}