Loggable

com.phasmidsoftware.visitor.util.Logging.Loggable
implicit class Loggable(w: String)

Provides logging capabilities for various types of data. The Loggable class augments a String with logging functionality, allowing logs to be generated for values or collections annotated with a specified logging prefix.

Use !! to log and return the original values of supported types. Logging can only occur if it is explicitly enabled within a suitable logging context.

Value parameters

w

the logging prefix to be used when generating log entries

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def !![X](x: X): X

Logs the provided value with the specified logging prefix and returns the original value. Logging occurs only if the logging context is active.

Logs the provided value with the specified logging prefix and returns the original value. Logging occurs only if the logging context is active.

Value parameters

x

the value to be logged; the type is generic and can be any type X

Attributes

Returns

the original value passed as input

def !![X](xo: Option[X]): Option[X]

Logs an Option value if logging is enabled and returns the original value.

Logs an Option value if logging is enabled and returns the original value.

Value parameters

xo

an Option containing the value to be logged; if xo is Some(value), the value is logged, otherwise no action is performed.

Attributes

Returns

the original Option value passed as input.

def !![X](xy: Try[X]): Try[X]

Logs a Try value using the logging prefix w and returns the original value. Logging occurs only if enabled within the logging context.

Logs a Try value using the logging prefix w and returns the original value. Logging occurs only if enabled within the logging context.

Value parameters

xy

the Try instance containing the value to be logged

Attributes

Returns

the same Try instance passed as input

def !![X](xy: Seq[X]): Seq[X]

Logs and returns the provided sequence of values. The sequence is logged with the prefix associated with the implicit Loggable context. Logging occurs only if logging is enabled in the current context.

Logs and returns the provided sequence of values. The sequence is logged with the prefix associated with the implicit Loggable context. Logging occurs only if logging is enabled in the current context.

Value parameters

xy

the sequence of values to be logged and returned

Attributes

Returns

the original sequence of values after logging