All Downloads are FREE. Search and download functionalities are using the official Maven repository.

slogging.multiLogger.scala Maven / Gradle / Ivy

There is a newer version: 0.6.1
Show newest version
// -   Project: slogging (https://github.com/jokade/slogging)
//      Module: shared
// Description: A logger implementation that wraps multiple UnderlyingLoggers.
//
// Distributed under the MIT License (see included file LICENSE)
package slogging

final class MultiLogger(loggers: Iterable[UnderlyingLogger]) extends AbstractUnderlyingLogger {

  override def error(source: String, message: String): Unit = loggers.foreach(_.error(source,message))
  override def error(source: String, message: String, cause: Throwable): Unit = loggers.foreach(_.error(source,message,cause))
  override def error(source: String, message: String, args: Any*): Unit = loggers.foreach(_.error(source,message,args:_*))

  override def warn(source: String, message: String): Unit = loggers.foreach(_.warn(source,message))
  override def warn(source: String, message: String, cause: Throwable): Unit = loggers.foreach(_.warn(source,message,cause))
  override def warn(source: String, message: String, args: Any*): Unit = loggers.foreach(_.warn(source,message,args:_*))

  override def info(source: String, message: String): Unit = loggers.foreach(_.info(source,message))
  override def info(source: String, message: String, cause: Throwable): Unit = loggers.foreach(_.info(source,message,cause))
  override def info(source: String, message: String, args: Any*): Unit = loggers.foreach(_.info(source,message,args:_*))

  override def debug(source: String, message: String): Unit = loggers.foreach(_.debug(source,message))
  override def debug(source: String, message: String, cause: Throwable): Unit = loggers.foreach(_.debug(source,message,cause))
  override def debug(source: String, message: String, args: Any*): Unit = loggers.foreach(_.debug(source,message,args:_*))

  override def trace(source: String, message: String): Unit = loggers.foreach(_.trace(source,message))
  override def trace(source: String, message: String, cause: Throwable): Unit = loggers.foreach(_.trace(source,message,cause))
  override def trace(source: String, message: String, args: Any*): Unit = loggers.foreach(_.trace(source,message,args:_*))

}

object MultiLogger {
  def apply(loggers: UnderlyingLogger*): MultiLogger = new MultiLogger(loggers)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy