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 Objecttrait Matchableclass Any
- Self type
-
Logging.type
Members list
Type members
Classlikes
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 Objecttrait Matchableclass Any
Value members
Concrete methods
Determines whether logging is currently enabled.
Determines whether logging is currently enabled.
Attributes
- Returns
-
true if logging is enabled, false otherwise
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
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
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