in util-logging/src/main/scala/com/twitter/logging/Logger.scala [83:148]
final def apply(level: Level, message: String, items: Any*): Unit = log(level, message, items: _*)
final def apply(level: Level, thrown: Throwable, message: String, items: Any*): Unit =
log(level, thrown, message, items: _*)
// convenience methods:
@varargs
def fatal(msg: String, items: Any*): Unit = log(Level.FATAL, msg, items: _*)
@varargs
def fatal(thrown: Throwable, msg: String, items: Any*): Unit =
log(Level.FATAL, thrown, msg, items: _*)
@varargs
def critical(msg: String, items: Any*): Unit = log(Level.CRITICAL, msg, items: _*)
@varargs
def critical(thrown: Throwable, msg: String, items: Any*): Unit =
log(Level.CRITICAL, thrown, msg, items: _*)
@varargs
def error(msg: String, items: Any*): Unit = log(Level.ERROR, msg, items: _*)
@varargs
def error(thrown: Throwable, msg: String, items: Any*): Unit =
log(Level.ERROR, thrown, msg, items: _*)
@varargs
def warning(msg: String, items: Any*): Unit = log(Level.WARNING, msg, items: _*)
@varargs
def warning(thrown: Throwable, msg: String, items: Any*): Unit =
log(Level.WARNING, thrown, msg, items: _*)
@varargs
def info(msg: String, items: Any*): Unit = log(Level.INFO, msg, items: _*)
@varargs
def info(thrown: Throwable, msg: String, items: Any*): Unit =
log(Level.INFO, thrown, msg, items: _*)
@varargs
def debug(msg: String, items: Any*): Unit = log(Level.DEBUG, msg, items: _*)
@varargs
def debug(thrown: Throwable, msg: String, items: Any*): Unit =
log(Level.DEBUG, thrown, msg, items: _*)
@varargs
def trace(msg: String, items: Any*): Unit = log(Level.TRACE, msg, items: _*)
@varargs
def trace(thrown: Throwable, msg: String, items: Any*): Unit =
log(Level.TRACE, thrown, msg, items: _*)
def debugLazy(msg: => AnyRef): Unit = logLazy(Level.DEBUG, null, msg)
def traceLazy(msg: => AnyRef): Unit = logLazy(Level.TRACE, null, msg)
/**
* Log a message, with lazy (call-by-name) computation of the message,
* at the desired level.
*/
def logLazy(level: Level, message: => AnyRef): Unit = logLazy(level, null: Throwable, message)
/**
* Log a message, with lazy (call-by-name) computation of the message,
* and attach an exception and stack trace.
*/
def logLazy(level: Level, thrown: Throwable, message: => AnyRef): Unit = {
val myLevel = getLevel()
if ((myLevel eq null) || (level.intValue >= myLevel.intValue)) {
val record = new LazyLogRecord(level, message)
record.setLoggerName(wrapped.getName)
if (thrown ne null) {
record.setThrown(thrown)
}
wrapped.log(record)
}
}