yasmin.logs module
- class yasmin.logs.LogLevel(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
IntEnum
@enum LogLevel @brief Enumeration for different log levels.
Defines the available log levels for controlling verbosity in the logging system.
- DEBUG = 3
- ERROR = 0
- INFO = 2
- WARN = 1
- yasmin.logs.YASMIN_LOG_DEBUG(text: str) None
Log a debug message with the caller’s information.
This function formats the log message to include the file name, function name, and line number where the log function was called.
@param text: The debug message to log. @type text: str
@return: None
- yasmin.logs.YASMIN_LOG_ERROR(text: str) None
Log an error message with the caller’s information.
This function formats the log message to include the file name, function name, and line number where the log function was called.
@param text: The error message to log. @type text: str
@return: None
- yasmin.logs.YASMIN_LOG_INFO(text: str) None
Log an informational message with the caller’s information.
This function formats the log message to include the file name, function name, and line number where the log function was called.
@param text: The informational message to log. @type text: str
@return: None
- yasmin.logs.YASMIN_LOG_WARN(text: str) None
Log a warning message with the caller’s information.
This function formats the log message to include the file name, function name, and line number where the log function was called.
@param text: The warning message to log. @type text: str
@return: None
- yasmin.logs.log_message(level: LogLevel, file: str, function: str, line: int, text: str) None
Default logging function.
This function is the default logging function of YASMIN.
@param level The log level as a string (e.g., “ERROR”, “WARN”, “INFO”, “DEBUG”). @param file The source file where the log function is called. @param function The function where the log function is called. @param line The line number in the source file. @param text The format string for the log message. @param args Additional arguments for the format string.
- yasmin.logs.set_default_loggers() None
Sets the default logging function for all log levels.
This function initializes the logging function to the default implementations.
- yasmin.logs.set_log_level(level: LogLevel) None
@brief Set the log level for the YASMIN framework.
Adjusts the log level to control the verbosity of logged messages.
@param level The new log level to be set.
- yasmin.logs.set_loggers(new_log_message: Callable[[LogLevel, str], None]) None
Set custom logger functions for YASMIN logging.
This function assigns user-defined logging function for different log levels: info, warning, debug, and error.
@param log_message: A callable function for logging messages. @type info: Callable[[LogLevel, str], None]
@return: None
@raises TypeError: If any of the parameters are not callable.