01: package edu.indiana.lib.osid.base.repository.http;
02:
03: public class Logger {
04: private static Logger _logger = new Logger();
05: private static org.osid.logging.WritableLog _log = null;
06:
07: /**
08: * Private constructor
09: */
10: private Logger() {
11: }
12:
13: /**
14: * Fetch a logger instance
15: */
16: public static Logger getInstance() {
17: return _logger;
18: }
19:
20: /**
21: * Return the active log
22: */
23: public static org.osid.logging.WritableLog getLog() {
24: return _log;
25: }
26:
27: /**
28: * Initialize a log for use
29: * @param log WritableLog instance for future use
30: */
31: public void initialize(org.osid.logging.WritableLog log) {
32: _log = log;
33: }
34:
35: /**
36: * Log a message
37: */
38: public void log(String entry)
39: throws org.osid.repository.RepositoryException {
40: if (_log != null) {
41: try {
42: _log.appendLog(entry);
43: } catch (org.osid.logging.LoggingException ignore) {
44: }
45: }
46: }
47: }
|