arjuna.tpi.log module

Log module contains helper functions for easy and pwoerful logging with Arjuna.

All log messages are directed to console as well as arjuna.log file which is generated on a per run basis and is placed in <project_root>/report/run_dir/log directory.

Messages generated by the test project as well as Arjuna go to the same log for easy checking of flow.

6 levels of logging are available:

  1. TRACE
  2. DEBUG
  3. INFO
  4. WARNING
  5. ERROR
  6. FATAL

These are represented by six different log_* functions.

TRACE has the lowest priority and FATAL has the highest priority amongst message levels.

Following Arjuna Options are related to logging:
  • LOG_CONSOLE_LEVEL: Minimum level of logging for a run for displaying log messages on console.
  • LOG_CONSOLE_LEVEL: Minimum level of logging for a run for displaying log messages in arjuna.log.
  • LOG_ALLOWED_CONTEXTS: The context strings which determine log messages belonging to which contexts can be displayed and logged.
arjuna.tpi.log.log_debug(msg: str, *, contexts: ListOrTupleOrStr = None) → None

Log a message with DEBUG level.

Parameters:
  • msg – Log message
  • contexts – (Optional) Context strings for this log message.
arjuna.tpi.log.log_error(msg: str, *, contexts: ListOrTupleOrStr = None) → None

Log a message with ERROR level.

Parameters:
  • msg – Log message
  • contexts – (Optional) Context strings for this log message.
arjuna.tpi.log.log_fatal(msg: str, *, contexts: ListOrTupleOrStr = None) → None

Log a message with FATAL level.

Parameters:
  • msg – Log message
  • contexts – (Optional) Context strings for this log message.
arjuna.tpi.log.log_info(msg: str, *, contexts: ListOrTupleOrStr = None) → None

Log a message with INFO level.

Parameters:
  • msg – Log message
  • contexts – (Optional) Context strings for this log message.
arjuna.tpi.log.log_trace(msg: str, *, contexts: ListOrTupleOrStr = None)

Log a message with TRACE level.

Parameters:
  • msg – Log message
  • contexts – (Optional) Context strings for this log message.
arjuna.tpi.log.log_warning(msg: str, *, contexts: ListOrTupleOrStr = None) → None

Log a message with WARNING level.

Parameters:
  • msg – Log message
  • contexts – (Optional) Context strings for this log message.