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

sbt.FullLogger.scala Maven / Gradle / Ivy

There is a newer version: 0.13.15
Show newest version
/* sbt -- Simple Build Tool
 * Copyright 2010 Mark Harrah
 */
package sbt

/** Promotes the simple Logger interface to the full AbstractLogger interface. */
class FullLogger(delegate: Logger) extends BasicLogger
{
	override val ansiCodesSupported: Boolean = delegate.ansiCodesSupported
	def trace(t: => Throwable)
	{
		if(traceEnabled)
			delegate.trace(t)
	}
	def log(level: Level.Value, message: => String)
	{
		if(atLevel(level))
			delegate.log(level, message)
	}
	def success(message: => String): Unit =
		if(successEnabled)
			delegate.success(message)
	def control(event: ControlEvent.Value, message: => String): Unit =
		info(message)
	def logAll(events: Seq[LogEvent]): Unit = events.foreach(log)
}
object FullLogger
{
	def apply(delegate: Logger): AbstractLogger =
		delegate match
		{
			case d: AbstractLogger => d
			case _ => new FullLogger(delegate)
		}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy