goodlog package

Submodules

goodlog.configuration module

goodlog.configuration.configure_logging(global_extra_info: dict[str, Any] | None = None) None[source]

goodlog.extra_info module

goodlog.factory module

goodlog.factory.create_logger(name: str) Logger[source]

goodlog.filters module

class goodlog.filters.AddExtraInfoFilter(name='')[source]

Bases: Filter

filter(record: LogRecord) bool[source]

Determine if the specified record is to be logged.

Returns True if the record should be logged, or False otherwise. If deemed appropriate, the record may be modified in-place.

goodlog.formats module

class goodlog.formats.JSONFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Bases: Formatter

format(record: LogRecord) str[source]

Format the specified record as text.

The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.

Module contents

goodlog.add(**kwargs: Any) None[source]
goodlog.configure_logging(global_extra_info: dict[str, Any] | None = None) None[source]
goodlog.create_logger(name: str) Logger[source]
goodlog.ephemeral_info_context(**extra_info: Any) Generator[None, None, None][source]
goodlog.remove() dict[str, Any][source]