Skip to content

_logging

Set up Application Logs

This module defines how the emitted application logs are handled and where they are written/streamed. The application logs are written in full details (ie with timestamps) to a file and also streamed to the console in a more concise format.

Console/Terminal Log:

- We Stream Logs of INFO (and above) Level on Console's stderr
- The rendered Log format is: <logger name>: <log level> <log message>

Disk File Log:

- we Write Logs of ALL Levels on a Disk File
- The rendered Log format is: <timestamp> <logger name>: <log level> <log message>
- The FILE_TARGET_LOGS, variable (see below), defines the path to the log file

Log Levels: - CRITICAL - ERROR - WARNING - INFO - DEBUG

Usage

Do a 'from . import _logging' in the root init.py of your package and all submodules 'inherit' the logging configuration

LOGS_FILE_NAME: str = FILE_TARGET_LOGS module-attribute

File name, to write, captured runtime Log records, in disk (filesystem).