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