gwkokab.analysis.utils.logger¶

Functions¶

custom_format(→ str)

Custom log format function for Loguru logger.

log_device_info(→ None)

Prints the device information.

log_gwkokab_info(→ None)

Prints the GWKokab version and the Python version.

log_info(→ None)

Log the information about the package and the device information.

set_log_level(→ None)

Set the log level for the logger.

time_now(→ str)

Get the current time as a string in the format YYYYMMDDHHMMSS.

Module Contents¶

gwkokab.analysis.utils.logger.custom_format(record, *, show_path: bool = False) str¶

Custom log format function for Loguru logger.

Parameters:

record (Record) – Record dictionary.

Returns:

Formatted log string.

Return type:

str

gwkokab.analysis.utils.logger.log_device_info() None¶

Prints the device information.

gwkokab.analysis.utils.logger.log_gwkokab_info() None¶

Prints the GWKokab version and the Python version.

gwkokab.analysis.utils.logger.log_info(start: bool = False) None¶

Log the information about the package and the device information.

Parameters:

start (bool, optional) – If True, log the start message, by default False

gwkokab.analysis.utils.logger.set_log_level() None¶

Set the log level for the logger.

The preset log level when initialising GWKokab is the value of the GWKOKAB_LOG_LEVEL environment variable, or ‘WARNING’ if the environment variable is unset.

Valid options of GWKOKAB_LOG_LEVEL are ‘TRACE’, ‘DEBUG’, ‘INFO’, ‘SUCCESS’, ‘WARNING’, ‘ERROR’, and ‘CRITICAL’.

gwkokab.analysis.utils.logger.time_now() str¶

Get the current time as a string in the format YYYYMMDDHHMMSS.

Returns:

The current time as a string.

Return type:

str