diff options
Diffstat (limited to 'src/main/java/org/uic/barcode/logger/Logger.java')
-rw-r--r-- | src/main/java/org/uic/barcode/logger/Logger.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/main/java/org/uic/barcode/logger/Logger.java b/src/main/java/org/uic/barcode/logger/Logger.java index b536154..baae70d 100644 --- a/src/main/java/org/uic/barcode/logger/Logger.java +++ b/src/main/java/org/uic/barcode/logger/Logger.java @@ -3,11 +3,23 @@ package org.uic.barcode.logger; import java.util.logging.Level;
-public class Logger {
+public class Logger {
+
+ private boolean consoleLog = false;
+
+ public Logger(boolean consoleLog) {
+ this.consoleLog = consoleLog;
+ }
+
+ public Logger() {
+ this.consoleLog = false;
+ }
public void debug(String text){
java.util.logging.Logger.getGlobal().log(Level.FINEST,text);
- System.out.println(text);
+ if (consoleLog) {
+ System.out.println(text);
+ }
}
public void log(Level level,String text){
@@ -17,6 +29,10 @@ public class Logger { public void info(String text, IllegalArgumentException e) {
java.util.logging.Logger.getGlobal().log(Level.INFO,text);
}
+
+ public void activateConsoleLog(boolean consoleLogActive) {
+ this.consoleLog = consoleLogActive;
+ }
}
|