Open richardogoma opened 11 months ago
See this article for insights
Normally you might write to a log file like this:
log.Debug("Incoming metrics data"); This would produce a line like this in your log:
DEBUG 2017-01-27 16:17:58 – Incoming metrics data
This gives insight into the logging function design and the log output.
See this article by Khuyen Khan. In fact implement this feature around it: Loguru: Simple as Print, Flexible as Logging
Here are some considerations:
logs/
directorylog
submodule, most likely in theload
submodule of theetl
module. This module has the following features: i. Contains functions to write the INFO and ERROR messages to aprogram.log
file in thelogs/
dir ii. Contains a default script that runs when the module is invoked. This script checks if the KiB of the log file exceeds 1024KiB (or a certain threshold), and if so, it rotates the log file. The old log file would be added to an archive (rar
orzip
format) in thelogs/
dirThe
log
submodule would have two functions: i.log.Info(info_msg)
which would handle the info messages ii.log.Error(error_msg)
which would handle the error messages__init__.py
file of theetl
module, the logging functions should be invoked appropriately in place of theprint
function currently in use