/** * Package access for testing purposes. */ static void reset() { SINGLETON = new StaticLoggerBinder(); SINGLETON.init(); }
/** * Package access allows only {@link SimpleLoggerFactory} to instantiate * SimpleLogger instances. */ SimpleLogger(String name) { this.name = name; String levelString = recursivelyComputeLevelString(); if (levelString != null) { this.currentLogLevel = SimpleLoggerConfiguration.stringToLevel(levelString); } else { this.currentLogLevel = CONFIG_PARAMS.defaultLogLevel; } }
/** * Currently this method always returns an instance of * {@link StaticMDCBinder}. */ public MDCAdapter getMDCA() { return new Log4jMDCAdapter(); }
/** * Perform single parameter substitution before logging the message of level * WARN according to the format outlined above. */ public void warn(String format, Object arg) { formatAndLog(LOG_LEVEL_WARN, format, arg, null); }
/** * A simple implementation which logs messages of level TRACE according to * the format outlined above. */ public void trace(String msg) { log(LOG_LEVEL_TRACE, msg, null); }
static void lazyInit() { if (INITIALIZED) { return; } INITIALIZED = true; init(); }
/** * Perform single parameter substitution before logging the message of level * ERROR according to the format outlined above. */ public void error(String format, Object arg) { formatAndLog(LOG_LEVEL_ERROR, format, arg, null); }
/** * A simple implementation which always logs messages of level ERROR * according to the format outlined above. */ public void error(String msg) { log(LOG_LEVEL_ERROR, msg, null); }
/** * Perform double parameter substitution before logging the message of level * INFO according to the format outlined above. */ public void info(String format, Object arg1, Object arg2) { formatAndLog(LOG_LEVEL_INFO, format, arg1, arg2); }
/** * A simple implementation which logs messages of level DEBUG according to * the format outlined above. */ public void debug(String msg) { log(LOG_LEVEL_DEBUG, msg, null); }
/** * Perform double parameter substitution before logging the message of level * INFO according to the format outlined above. */ public void info(String format, Object... argArray) { formatAndLog(LOG_LEVEL_INFO, format, argArray); }
/** * A simple implementation which logs messages of level INFO according to * the format outlined above. */ public void info(String msg) { log(LOG_LEVEL_INFO, msg, null); }
/** * Perform double parameter substitution before logging the message of level * ERROR according to the format outlined above. */ public void error(String format, Object arg1, Object arg2) { formatAndLog(LOG_LEVEL_ERROR, format, arg1, arg2); }
/** * Perform single parameter substitution before logging the message of level * TRACE according to the format outlined above. */ public void trace(String format, Object param1) { formatAndLog(LOG_LEVEL_TRACE, format, param1, null); }
/** * Perform double parameter substitution before logging the message of level * TRACE according to the format outlined above. */ public void trace(String format, Object param1, Object param2) { formatAndLog(LOG_LEVEL_TRACE, format, param1, param2); }
/** * Perform double parameter substitution before logging the message of level * TRACE according to the format outlined above. */ public void trace(String format, Object... argArray) { formatAndLog(LOG_LEVEL_TRACE, format, argArray); }
/** * Perform double parameter substitution before logging the message of level * DEBUG according to the format outlined above. */ public void debug(String format, Object param1, Object param2) { formatAndLog(LOG_LEVEL_DEBUG, format, param1, param2); }
/** * Perform double parameter substitution before logging the message of level * WARN according to the format outlined above. */ public void warn(String format, Object arg1, Object arg2) { formatAndLog(LOG_LEVEL_WARN, format, arg1, arg2); }
/** * Perform single parameter substitution before logging the message of level * DEBUG according to the format outlined above. */ public void debug(String format, Object param1) { formatAndLog(LOG_LEVEL_DEBUG, format, param1, null); }
/** * Perform single parameter substitution before logging the message of level * INFO according to the format outlined above. */ public void info(String format, Object arg) { formatAndLog(LOG_LEVEL_INFO, format, arg, null); }