Slf4jLogger

com.phasmidsoftware.matchers.Slf4jLogger
case class Slf4jLogger(logLevel: LogLevel, logger: Logger) extends MatchLogger

A case class that wraps SLF4J logging functionality, extending MatchLogger to utilize a specified logging level and SLF4J logger instance for log operations.

Value parameters

logLevel

The logging level to control the behavior of the logger, determining whether logs are written based on the specified level (e.g., LogInfo, LogDebug).

logger

The SLF4J Logger instance used for performing the logging operations. The class delegates the actual logging operations to SLF4J's Logger methods based on the provided logging level: - Logs at the info level if the logLevel is LogInfo. - Logs at the debug level if the logLevel is LogDebug. - Skips logging for other levels. Inherits functionality from MatchLogger, allowing it to act as a functional logger with behavior controlled by the specified logLevel.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class MatchLogger
trait String => Unit
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def andThen[A](g: Unit => A): String => A

Composes two instances of Function1 in a new Function1, with this function applied first.

Composes two instances of Function1 in a new Function1, with this function applied first.

Type parameters

A

the result type of function g

Value parameters

g

a function R => A

Attributes

Returns

a new function f such that f(x) == g(apply(x))

Inherited from:
Function1
override def apply(w: String): Unit

Applies the provided logging function if the logging level is LogInfo or LogDebug. The log action is skipped if the logging level does not match these criteria.

Applies the provided logging function if the logging level is LogInfo or LogDebug. The log action is skipped if the logging level does not match these criteria.

Value parameters

w

The input string to be logged by the provided logging function.

Attributes

Returns

Unit value indicating the completion of the logging action or its omission based on the log level.

Definition Classes
MatchLogger -> Function1
Inherited from:
MatchLogger
def compose[A](g: A => String): A => Unit

Composes two instances of Function1 in a new Function1, with this function applied last.

Composes two instances of Function1 in a new Function1, with this function applied last.

Type parameters

A

the type to which function g can be applied

Value parameters

g

a function A => T1

Attributes

Returns

a new function f such that f(x) == apply(g(x))

Inherited from:
Function1
def disabled: Boolean

Indicates whether the logger is disabled.

Indicates whether the logger is disabled.

Attributes

Returns

True if the logging level is LogOff, meaning no logging will occur; otherwise, false.

Inherited from:
MatchLogger
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1