Logger

class coba.context.Logger

The interface for a logger.

Methods

abstract 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.

abstract 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

The sink the logger writes to.