Nautobot Plugin Nornir Logger¶
nautobot_plugin_nornir.logger
¶
Custom logger to support writing to console and db.
DebugLoggingMixin
¶
Job mixin to only record debug log messages when the job's debug input is enabled.
Nautobot sets job loggers to DEBUG so that every message reaches the job result. This mixin sets the job
logger to DEBUG or INFO from the debug job input before the job runs, and restores the original level
afterwards. List it before Job in the job's bases, and pass self.logger.getEffectiveLevel() to
NornirLogger so Nornir plays follow the same level.
Source code in nautobot_plugin_nornir/logger.py
after_return(status, retval, task_id, args, kwargs, einfo)
¶
Restore the job logger level saved in before_start.
Source code in nautobot_plugin_nornir/logger.py
before_start(task_id, args, kwargs)
¶
Set the job logger level from the debug input.
Source code in nautobot_plugin_nornir/logger.py
NornirLogger
¶
Logger that handles same signature as standard Python Library logging but also write to db.