From bfb7a87766a907e1764ac5608c6e448f1681f815 Mon Sep 17 00:00:00 2001 From: CGantert345 <57003061+CGantert345@users.noreply.github.com> Date: Fri, 3 Jan 2020 10:34:39 +0100 Subject: logging --- src/logger/Logger.java | 24 ++++++++++++++++++++++++ src/logger/LoggerFactory.java | 9 +++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/logger/Logger.java create mode 100644 src/logger/LoggerFactory.java (limited to 'src/logger') diff --git a/src/logger/Logger.java b/src/logger/Logger.java new file mode 100644 index 0000000..e6d7638 --- /dev/null +++ b/src/logger/Logger.java @@ -0,0 +1,24 @@ +package logger; + +import java.util.logging.Level; + + +public class Logger { + + public void debug(String text){ + java.util.logging.Logger.getGlobal().log(Level.FINEST,text); + System.out.println(text); + } + + public void log(Level level,String text){ + java.util.logging.Logger.getGlobal().log(level,text); + } + + public void info(String text, IllegalArgumentException e) { + java.util.logging.Logger.getGlobal().log(Level.INFO,text); + } + + +} + + diff --git a/src/logger/LoggerFactory.java b/src/logger/LoggerFactory.java new file mode 100644 index 0000000..7b92669 --- /dev/null +++ b/src/logger/LoggerFactory.java @@ -0,0 +1,9 @@ +package logger; + +public class LoggerFactory { + + public static Logger getLogger(String name) { + return new Logger(); + } + +} -- cgit v1.2.3