savant_rs.logging

class savant_rs.logging.LogLevel

Allows defining a log level for a logging subsystem

Returns:

The log level. By default, the log level is set to Info.

Return type:

LogLevel

Debug = Debug
Error = Error
Info = Info
Off = Off
Trace = Trace
Warning = Warning
savant_rs.logging.get_log_level()

Get the current log level for the logger.

Returns:

The current log level.

Return type:

LogLevel

savant_rs.logging.log(level, target, message, params=None, no_gil=True)

Logs a message.

GIL Management: This function releases the GIL optionally.

Parameters:
  • level (LogLevel) – The log level to use.

  • target (str) – The code initiated the log message. The target is defined as a::b::c

  • message (str) – The log message.

  • params (dict) – The log message parameters.

  • no_gil (bool) – If True, the GIL is released when the function is executed.

savant_rs.logging.log_level_enabled(level)

Check if the given log level is enabled.

Parameters:

level (LogLevel) – The log level to check.

Returns:

True if the log level is enabled, False otherwise.

Return type:

bool

savant_rs.logging.set_log_level(level)

Set the log level for the logger.

Parameters:

level (LogLevel) – The log level to set.

Returns:

The previous log level.

Return type:

LogLevel