BasicLogger

class coba.context.BasicLogger

A Logger with flat hierarchy.

Constructors

__init__(sink: ~coba.primitives.Sink[str] = <coba.pipes.sinks.ConsoleSink object>)

Instantiate a BasicLogger.

Parameters:

sink – The sink to write to (by default console).

Methods

log(message: str) ContextManager[Logger]

Log a message or exception to the sink.

Parameters:

message – The message or exception that should be logged.

Returns:

A ContextManager that controls hierarchy.

time(message: str) ContextManager[Logger]

Log a timed message to the sink.

Parameters:

message – The message that should be logged.

Returns:

A ContextManager that controls when timing stops.

Attributes

sink