IndentLogger

class coba.context.IndentLogger

A Logger with indented hierarchy.

Constructors

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

Instantiate an IndentLogger.

Parameters:

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

Methods

log(message: str | Exception) 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