[Tutor] Please help disentangle my program logic
Mats Wichmann
mats at wichmann.us
Sun Jan 5 13:34:32 EST 2020
On 1/5/20 11:23 AM, Robert Alexander wrote:
> Thank you Mats. Very interesting observation.
>
> May you kindly expand on why you are suggesting this?
>
> In my opinion specifying a log name at runtime gives me more flexibility
> but I might be not considering some other important reason.
Not sure I'm answering the right question here, but...
You can still specify the logging location on the command line by
accepting an argument, and having a default in the program if it's not
on the command line.
The logigng module gives you the flexibility to log to different places,
even - you can put every reading in the log, and important events (like
Internet connection is down) somewhere else - your console, sending by
email (I'm not sure that's directly supported, but wouldn't be hard to
set up), by assigning different log levels to different types of events.
>
> Ciao
>
> PS Etiquette question please: Is it better to reply to both the sender and
> the list or the list only?
>
>
> On 5 January 2020 at 19:18:30, Mats Wichmann (mats at wichmann.us) wrote:
>
> quick reaction: look into the logging module to control how, where and
> what to log. No need to reinvent the wheel.
More information about the Tutor
mailing list