Logging

com.phasmidsoftware.visitor.util.Logging
object Logging

The Logging object provides functionality for flexible and controlled logging of messages and data. It allows toggling logging state, configuring custom logging functions, and logging collections or values with specified prefixes.

The class also defines the implicit Loggable class, which provides syntactic sugar for logging via the !! operator.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Logging.type

Members list

Type members

Classlikes

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.

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

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def isLogging: Boolean

Determines whether logging is currently enabled.

Determines whether logging is currently enabled.

Attributes

Returns

true if logging is enabled, false otherwise

def setLogFunction(f: String => Unit): Unit

Sets the log function to be used for logging messages.

Sets the log function to be used for logging messages.

Value parameters

f

a function that takes a String message as input and processes it (e.g., logs it)

Attributes

Returns

Unit this method does not return a value

def setLogging(b: Boolean): Unit

Sets the logging state to either enabled or disabled.

Sets the logging state to either enabled or disabled.

Value parameters

b

a boolean value indicating whether logging should be enabled (true) or disabled (false)

Attributes

Returns

Unit

Implicits

Implicits

final implicit def Loggable(w: String): Loggable

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.

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