Skip to content

Setup logging according to the logging cookbook#68

Open
HaasCM wants to merge 1 commit intotehruttiger:masterfrom
HaasCM:update-logging
Open

Setup logging according to the logging cookbook#68
HaasCM wants to merge 1 commit intotehruttiger:masterfrom
HaasCM:update-logging

Conversation

@HaasCM
Copy link
Copy Markdown
Collaborator

@HaasCM HaasCM commented Mar 19, 2025

Python has the logging cookbook (please see
https://docs.python.org/3/library/logging.html for more info). It basically allows you tos setup the logger to log to both a file and the console, while using two different formatters.

So converted the logging functionality to using the python logging module with two seperate handlers, one for console and one for file.

This also allowed us to clean up the print statements that duplicated the log messages as the handlers would handle console and file output.

Also setup the formatters to capture the time of the log message so we don't need to record the time in the log messasge anymore.

Python has the logging cookbook (please see
https://docs.python.org/3/library/logging.html for more info). It
basically allows you tos setup the logger to log to both a file
and the console, while using two different formatters.

So converted the logging functionality to using the python
logging module with two seperate handlers, one for console
and one for file.

This also allowed us to clean up the print statements that
duplicated the log messages as the handlers would handle
console and file output.

Also setup the formatters to capture the time of the log message
so we don't need to record the time in the log messasge anymore.
@tehruttiger
Copy link
Copy Markdown
Owner

@HaasCM I've invited you to collaborate. Hoping you're interested as I don't actively update Stockpiler anymore.

@HaasCM
Copy link
Copy Markdown
Collaborator Author

HaasCM commented Mar 21, 2025

Sure! Just accepted the invite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants