in actor/src/main/scala/org/apache/pekko/event/Logging.scala [1753:1997]
def this(bus: LoggingBus, logSource: String, logClass: Class[_]) =
this(bus, logSource, logClass, new DefaultLoggingFilter(() => bus.logLevel))
val loggingFilterWithMarker: LoggingFilterWithMarker = LoggingFilterWithMarker.wrap(loggingFilter)
def isErrorEnabled(marker: LogMarker) = loggingFilterWithMarker.isErrorEnabled(logClass, logSource, marker)
def isWarningEnabled(marker: LogMarker) = loggingFilterWithMarker.isWarningEnabled(logClass, logSource, marker)
def isInfoEnabled(marker: LogMarker) = loggingFilterWithMarker.isInfoEnabled(logClass, logSource, marker)
def isDebugEnabled(marker: LogMarker) = loggingFilterWithMarker.isDebugEnabled(logClass, logSource, marker)
/**
* Log message at error level, including the exception that caused the error.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def error(marker: LogMarker, cause: Throwable, message: String): Unit =
if (isErrorEnabled(marker)) bus.publish(Error(cause, logSource, logClass, message, mdc, marker))
/**
* Message template with 1 replacement argument.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
*
* If `arg1` is an `Array` it will be expanded into replacement arguments, which is useful when
* there are more than four arguments.
* @see [[LoggingAdapter]]
*/
def error(marker: LogMarker, cause: Throwable, template: String, arg1: Any): Unit =
if (isErrorEnabled(marker)) bus.publish(Error(cause, logSource, logClass, format1(template, arg1), mdc, marker))
/**
* Message template with 2 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def error(marker: LogMarker, cause: Throwable, template: String, arg1: Any, arg2: Any): Unit =
if (isErrorEnabled(marker))
bus.publish(Error(cause, logSource, logClass, format(template, arg1, arg2), mdc, marker))
/**
* Message template with 3 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def error(marker: LogMarker, cause: Throwable, template: String, arg1: Any, arg2: Any, arg3: Any): Unit =
if (isErrorEnabled(marker))
bus.publish(Error(cause, logSource, logClass, format(template, arg1, arg2, arg3), mdc, marker))
/**
* Message template with 4 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def error(marker: LogMarker, cause: Throwable, template: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): Unit =
if (isErrorEnabled(marker))
bus.publish(Error(cause, logSource, logClass, format(template, arg1, arg2, arg3, arg4), mdc, marker))
/**
* Log message at error level, without providing the exception that caused the error.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def error(marker: LogMarker, message: String): Unit =
if (isErrorEnabled(marker)) bus.publish(Error(logSource, logClass, message, mdc, marker))
/**
* Message template with 1 replacement argument.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
*
* If `arg1` is an `Array` it will be expanded into replacement arguments, which is useful when
* there are more than four arguments.
* @see [[LoggingAdapter]]
*/
def error(marker: LogMarker, template: String, arg1: Any): Unit =
if (isErrorEnabled(marker)) bus.publish(Error(logSource, logClass, format1(template, arg1), mdc, marker))
/**
* Message template with 2 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def error(marker: LogMarker, template: String, arg1: Any, arg2: Any): Unit =
if (isErrorEnabled(marker)) bus.publish(Error(logSource, logClass, format(template, arg1, arg2), mdc, marker))
/**
* Message template with 3 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def error(marker: LogMarker, template: String, arg1: Any, arg2: Any, arg3: Any): Unit =
if (isErrorEnabled(marker)) bus.publish(Error(logSource, logClass, format(template, arg1, arg2, arg3), mdc, marker))
/**
* Message template with 4 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def error(marker: LogMarker, template: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): Unit =
if (isErrorEnabled(marker))
bus.publish(Error(logSource, logClass, format(template, arg1, arg2, arg3, arg4), mdc, marker))
/**
* Log message at warning level.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def warning(marker: LogMarker, message: String): Unit =
if (isWarningEnabled(marker)) bus.publish(Warning(logSource, logClass, message, mdc, marker))
/**
* Message template with 1 replacement argument.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
*
* If `arg1` is an `Array` it will be expanded into replacement arguments, which is useful when
* there are more than four arguments.
* @see [[LoggingAdapter]]
*/
def warning(marker: LogMarker, template: String, arg1: Any): Unit =
if (isWarningEnabled(marker)) bus.publish(Warning(logSource, logClass, format1(template, arg1), mdc, marker))
/**
* Message template with 2 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def warning(marker: LogMarker, template: String, arg1: Any, arg2: Any): Unit =
if (isWarningEnabled(marker)) bus.publish(Warning(logSource, logClass, format(template, arg1, arg2), mdc, marker))
/**
* Message template with 3 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def warning(marker: LogMarker, template: String, arg1: Any, arg2: Any, arg3: Any): Unit =
if (isWarningEnabled(marker))
bus.publish(Warning(logSource, logClass, format(template, arg1, arg2, arg3), mdc, marker))
/**
* Message template with 4 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def warning(marker: LogMarker, template: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): Unit =
if (isWarningEnabled(marker))
bus.publish(Warning(logSource, logClass, format(template, arg1, arg2, arg3, arg4), mdc, marker))
/**
* Log message at info level.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def info(marker: LogMarker, message: String): Unit =
if (isInfoEnabled(marker)) bus.publish(Info(logSource, logClass, message, mdc, marker))
/**
* Message template with 1 replacement argument.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
*
* If `arg1` is an `Array` it will be expanded into replacement arguments, which is useful when
* there are more than four arguments.
* @see [[LoggingAdapter]]
*/
def info(marker: LogMarker, template: String, arg1: Any): Unit =
if (isInfoEnabled(marker)) bus.publish(Info(logSource, logClass, format1(template, arg1), mdc, marker))
/**
* Message template with 2 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def info(marker: LogMarker, template: String, arg1: Any, arg2: Any): Unit =
if (isInfoEnabled(marker)) bus.publish(Info(logSource, logClass, format(template, arg1, arg2), mdc, marker))
/**
* Message template with 3 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def info(marker: LogMarker, template: String, arg1: Any, arg2: Any, arg3: Any): Unit =
if (isInfoEnabled(marker)) bus.publish(Info(logSource, logClass, format(template, arg1, arg2, arg3), mdc, marker))
/**
* Message template with 4 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def info(marker: LogMarker, template: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): Unit =
if (isInfoEnabled(marker))
bus.publish(Info(logSource, logClass, format(template, arg1, arg2, arg3, arg4), mdc, marker))
/**
* Log message at debug level.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def debug(marker: LogMarker, message: String): Unit =
if (isDebugEnabled(marker)) bus.publish(Debug(logSource, logClass, message, mdc, marker))
/**
* Message template with 1 replacement argument.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
*
* If `arg1` is an `Array` it will be expanded into replacement arguments, which is useful when
* there are more than four arguments.
* @see [[LoggingAdapter]]
*/
def debug(marker: LogMarker, template: String, arg1: Any): Unit =
if (isDebugEnabled(marker)) bus.publish(Debug(logSource, logClass, format1(template, arg1), mdc, marker))
/**
* Message template with 2 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def debug(marker: LogMarker, template: String, arg1: Any, arg2: Any): Unit =
if (isDebugEnabled(marker)) bus.publish(Debug(logSource, logClass, format(template, arg1, arg2), mdc, marker))
/**
* Message template with 3 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def debug(marker: LogMarker, template: String, arg1: Any, arg2: Any, arg3: Any): Unit =
if (isDebugEnabled(marker)) bus.publish(Debug(logSource, logClass, format(template, arg1, arg2, arg3), mdc, marker))
/**
* Message template with 4 replacement arguments.
* The marker argument can be picked up by various logging frameworks such as slf4j to mark this log statement as "special".
* @see [[LoggingAdapter]]
*/
def debug(marker: LogMarker, template: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): Unit =
if (isDebugEnabled(marker))
bus.publish(Debug(logSource, logClass, format(template, arg1, arg2, arg3, arg4), mdc, marker))
/**
* Log message at the specified log level.
*/
def log(marker: LogMarker, level: Logging.LogLevel, message: String): Unit = {
level match {
case Logging.DebugLevel => debug(marker, message)
case Logging.InfoLevel => info(marker, message)
case Logging.WarningLevel => warning(marker, message)
case Logging.ErrorLevel => error(marker, message)
case _ =>
}
}