isomer.logger module

Module: Logger

Isomer’s own logger to avoid namespace clashes etc. Comes with some fancy functions.

Log Levels

verbose = 5 debug = 10 info = 20 warn = 30 error = 40 critical = 50 off = 100

clear()[source]

Clear the live log

get_logfile() → str[source]

Return the whole filename of the logfile

get_verbosity()[source]

Returns logging verbosity

is_marked(what) → bool[source]

Check if log line qualifies for highlighting

is_muted(what) → bool[source]

Checks if a logged event is to be muted for debugging purposes.

Also goes through the solo list - only items in there will be logged!

Return type:bool
Parameters:what
isolog(*what, **kwargs)[source]

Logs all non keyword arguments.

Parameters:
  • what (tuple/str) – Loggable objects (i.e. they have a string representation)
  • lvl (int) – Debug message level
  • emitter (str) – Optional log source, where this can’t be determined automatically
  • sourceloc (str) – Give specific source code location hints, used internally
  • frameref (int) – Specify a non default frame for tracebacks
  • tb (bool) – Include a traceback
  • nc (bool) – Do not use color
  • exc (bool) – Switch to better handle exceptions, use if logging in an except clause
set_color()[source]

Activate colorful logging

set_logfile(path: str, instance: str, filename: str = None)[source]

Specify logfile path

Parameters:
  • path (str) – Path to the logfile
  • instance (str) – Name of the instance
  • filename (str) – Exact name of logfile
set_verbosity(global_level: int, console_level: int = None, file_level: int = None)[source]

Adjust logging verbosity

setup_root(new_root: isomer.components.Component)[source]

Sets up the root component, so the logger knows where to send logging signals.

Parameters:new_root (isomer.components.Component) –