Logging facilities#
RedSun logging module.
In each RedSun application, only one logger is created.
All classes inheriting the Loggable
class can log messages via the core logger.
- class sunflare.log.Loggable#
Class to extend log records with the class name and the user defined ID.
Models and controllers can inherit from this class to have a consistent log format.
All methods allow to forward extra arguments to the logger calls as documented in the logging module.
- critical(msg, *args, **kwargs)#
Log a critical message in the core logger.
- Parameters:
msg (
str
) – String to log.*args (
Any
) – Additional positional arguments forlogging.Logger.critical
.**kwargs (
Any
) – Additional keyword arguments forlogging.Logger.critical
.
- Return type:
None
- debug(msg, *args, **kwargs)#
Log a debug message in the core logger.
- Parameters:
msg (
str
) – String to log.*args (
Any
) – Additional positional arguments forlogging.Logger.debug
.**kwargs (
Any
) – Additional keyword arguments forlogging.Logger.debug
.
- Return type:
None
- error(msg, *args, **kwargs)#
Log an error. message in the core logger.
- Parameters:
msg (
str
) – String to log.*args (
Any
) – Additional positional arguments forlogging.Logger.error
.**kwargs (
Any
) – Additional keyword arguments forlogging.Logger.error
.
- Return type:
None
- exception(msg, *args, **kwargs)#
Log an exception message in the core logger.
- Parameters:
msg (
str
) – String to log.*args (
Any
) – Additional positional arguments forlogging.Logger.exception
.**kwargs (
Any
) – Additional keyword arguments forlogging.Logger.exception
.
- Return type:
None
- info(msg, *args, **kwargs)#
Log an info message in the core logger.
- Parameters:
msg (
str
) – String to log.*args (
Any
) – Additional positional arguments forlogging.Logger.info
.**kwargs (
Any
) – Additional keyword arguments forlogging.Logger.info
.
- Return type:
None
- property name: str#
Class instance unique identifier.
This property should be implemented by all model and controller classes by default.
- Meta-private:
- warning(msg, *args, **kwargs)#
Log a warning message in the core logger.
- Parameters:
msg (
str
) – String to log.*args (
Any
) – Additional positional arguments forlogging.Logger.warning
.**kwargs (
Any
) – Additional keyword arguments forlogging.Logger.warning
.
- Return type:
None
- sunflare.log.get_logger()#
Return the core logger.
- Returns:
The core logger instance.
- Return type:
logging.Logger