Master Logger Support

This contains the logic that creates a custom Python logger which is used throughout this Alpaca driver app. The Python construction details are within the initialization function.

Attention

For more details see Logging Support.

The logger may be called from anywhere. Look at the rotatordevice.py module to see how it is constructed, including the app passing the Logger reference as an initilization paremeter.

log.init_logging()

Create the logger - called at app startup

MASTER LOGGER

This single logger is used throughout. The module name (the param for get_logger()) isn’t needed and would be ‘root’ anyway, sort of useless. Logs time stamps in UTC/ISO format, and with fractional seconds. Since our config options allow for suppression of logging to stdout, we remove the default stdout handler. Thank heaven that Python logging is thread-safe!

This logger is passed around throughout the app and may be used throughout, even the device control. The config.Config class has options to control the number of back generations of logs to keep, as well as the max size (at which point the log will be rotated). Also there is an option to cause logged messages to go to the console for debugging purposes. A new log is started each time the app is started.

Returns:

Customized Python logger.