This python-log-helper
repo is the culmination of a long standing desire to make logging easier while leveraging decorators.
- Business Requirements
- Current Status
- Additional Resources
Here are the requirements & nice to haves in relation to this project.
Aside from being easily imported into any repo ...
- Provide easy way to add logging to a repo without having to recreate the settings for each project
- Have a decorator function that provides
DEBUG
entry and exit for functions - Provide way to turn on / off logging to console (set level to anything other than
WARNING
) - Provide way for choice in what logging file is saved
- Have some way to show start/end of logging in the file per run
- Have formatting show time, file name, function name, and logging level in saved logs (to start)
- easy way to show start and stop of log file logs for each run
- Leverage built in functions of logger to limit the number of files chosen when starting run
- Flexible options for formatting (both console and file)
- Have way to email log file(s)
- Consider this when looking to move to a class
v1] was to get everything set up and working as functions.
v2 was to migrate from functions to classes, with some fixes and improvements along the way.
v3 was fixing some of the issues found within v2 (like not having modularity).
v4 was to begin adding testing to the code, but other issues were found while fixing some of the work. Eventually bringing us to where we are now ... where for some reason the console is logging twice on import when it wasn't before. Latest as of 20240217.
The following were used to build this repo: