Reference

fagfunksjoner package

Subpackages

fagfunksjoner.fagfunksjoner_logger module

class ColoredFormatter(*args, colors=None, **kwargs)

Bases: Formatter

Colored log formatter.

Initialize the formatter with specified format strings.

Parameters:
  • args (Any)

  • colors (dict[str, str] | None)

  • kwargs (Any)

format(record)

Format the specified record as text.

Return type:

str

Parameters:

record (LogRecord)

silence_logger(func, *args, **kwargs)

Silences INFO and WARNING logs for the duration of the function call.

Return type:

Any

Parameters:
  • func (Callable[[...], Any])

  • args (Any)

  • kwargs (Any)