pip_services3_components.log.ILogger module

pip_services3_components.log.ILogger

Interface for logging components.

copyright

Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.

license

MIT, see LICENSE for more details.

class pip_services3_components.log.ILogger.ILogger

Bases: abc.ABC

Interface for logger components that capture execution log messages.

debug(correlation_id: Optional[str], message: str, *args: Any, **kwargs: Any)

Logs a high-level debug information for troubleshooting.

Parameters
  • correlation_id – (optional) transaction id to trace execution through call chain.

  • message – a human-readable message to log.

  • args – arguments to parameterize the message.

  • kwargs – arguments to parameterize the message.

error(correlation_id: Optional[str], error: Exception, message: str, *args: Any, **kwargs: Any)

Logs recoverable application error.

Parameters
  • correlation_id – (optional) transaction id to trace execution through call chain.

  • error – an error object associated with this message.

  • message – a human-readable message to log.

  • args – arguments to parameterize the message.

  • kwargs – arguments to parameterize the message.

fatal(correlation_id: Optional[str], error: Exception, message: str, *args: Any, **kwargs: Any)

Logs fatal (unrecoverable) message that caused the process to crash.

Parameters
  • correlation_id – (optional) transaction id to trace execution through call chain.

  • error – an error object associated with this message.

  • message – a human-readable message to log.

  • args – arguments to parameterize the message.

  • kwargs – arguments to parameterize the message.

get_level() → <module ‘pip_services3_components.log.LogLevel’ from ‘/pip_services3_components/log/LogLevel.py’>

Gets the maximum log level. Messages with higher log level are filtered out.

Returns

the maximum log level.

info(correlation_id: Optional[str], message: str, *args: Any, **kwargs: Any)

Logs an important information message

Parameters
  • correlation_id – (optional) transaction id to trace execution through call chain.

  • message – a human-readable message to log.

  • args – arguments to parameterize the message.

  • kwargs – arguments to parameterize the message.

log(level: <module 'pip_services3_components.log.LogLevel' from '/pip_services3_components/log/LogLevel.py'>, correlation_id: Optional[str], error: Optional[Exception], message: Optional[str], *args: Any, **kwargs: Any)

Logs a message at specified log level.

Parameters
  • level – a log level.

  • correlation_id – (optional) transaction id to trace execution through call chain.

  • error – an error object associated with this message.

  • message – a human-readable message to log.

  • args – arguments to parameterize the message.

  • kwargs – arguments to parameterize the message.

set_level(level: <module 'pip_services3_components.log.LogLevel' from '/pip_services3_components/log/LogLevel.py'>)

Set the maximum log level.

Parameters

level – a new maximum log level.

trace(correlation_id: Optional[str], message: str, *args: Any, **kwargs: Any)

Logs a low-level debug information for troubleshooting.

Parameters
  • correlation_id – (optional) transaction id to trace execution through call chain.

  • message – a human-readable message to log.

  • args – arguments to parameterize the message.

  • kwargs – arguments to parameterize the message.

warn(correlation_id: Optional[str], message: Exception, *args: Any, **kwargs: Any)

Logs a warning that may or may not have a negative impact.

Parameters
  • correlation_id – (optional) transaction id to trace execution through call chain.

  • message – a human-readable message to log.

  • args – arguments to parameterize the message.

  • kwargs – arguments to parameterize the message.