01: package com.jamonapi.utils;
02:
03: /** Very Simple Utility class used for Logging. **/
04:
05: public class Logger extends java.lang.Object {
06: String prefix = "";
07:
08: protected Logger() {
09: }
10:
11: private static Logger logger = new Logger();
12:
13: private static Logger createInstance() {
14: return logger;
15: }
16:
17: public static void log(Object obj) {
18: createInstance().instanceLog(obj);
19: }
20:
21: public static void logInfo(Object obj) {
22: // This function will be able to be disabled at runtime. i.e. do nothing whereas log is permanent.
23: // for now they do the same thing however.
24: createInstance().instanceLog(obj);
25: }
26:
27: public static void logDebug(Object obj) {
28: // This function will be able to be disabled at runtime. i.e. do nothing whereas log is permanent.
29: // for now they do the same thing however.
30: createInstance().instanceLog(obj);
31: }
32:
33: protected void instanceLog(Object obj) {
34: System.out.println(prefix + obj);
35: }
36: }
|