Logger

class mosaic.utils.logger.LoggerManager[source]

Bases: object

Class that manages the creation loggers and the interface with them. It creates local or remote loggers and handles the communication with loggers at different levels info, debug, error and warning.

debug(buf, uid=None)[source]

Log message with level debug.

Parameters:
  • buf (str) – Message to log.

  • uid (str, optional) – UID of the runtime from which the message originates, defaults to current runtime.

error(buf, uid=None)[source]

Log message with level error.

Parameters:
  • buf (str) – Message to log.

  • uid (str, optional) – UID of the runtime from which the message originates, defaults to current runtime.

info(buf, uid=None)[source]

Log message with level info.

Parameters:
  • buf (str) – Message to log.

  • uid (str, optional) – UID of the runtime from which the message originates, defaults to current runtime.

perf(buf, uid=None)[source]

Log message with level perf.

Parameters:
  • buf (str) – Message to log.

  • uid (str, optional) – UID of the runtime from which the message originates, defaults to current runtime.

async send()[source]
set_default(format='interactive')[source]

Set up default loggers.

static set_level(level)[source]

Set log level from options info, debug, error and warning.

Parameters:

level (str) – Log level

set_local(format='remote')[source]

Set up local loggers.

set_remote(runtime_id='monitor', format='remote')[source]

Set up remote loggers.

Parameters:

runtime_id (str, optional) – Runtime to which logging will be directed, defaults to monitor.

warn(buf, uid=None)[source]

Log message with level warning.

Parameters:
  • buf (str) – Message to log.

  • uid (str, optional) – UID of the runtime from which the message originates, defaults to current runtime.

warning(buf, uid=None)[source]

Log message with level warning.

Parameters:
  • buf (str) – Message to log.

  • uid (str, optional) – UID of the runtime from which the message originates, defaults to current runtime.

mosaic.utils.logger.clear_logger()[source]