How to test?
DL Neil
PythonList at DancesWithMice.info
Fri Apr 24 18:04:55 EDT 2020
>> May I point-out that the above may not be the best approach. Rather
>> than using screen-prints to report errors, another method is to
>> utilise "logging" to collect such data - so that there is always a
>> formal record (regardless of user behavior). During 'production' the
>> information could be collected at some central 'location' for
>> inspection by competent staff. During 'development', it is possible,
>> by changing one line, to re-direct the log to wherever you would like
>> - including the above!
>>
>
> Logging wouldn't help here as the person running the program is
> competent, and it likes to see what the errors are.
Perhaps it is a 'traditional view' that "logging" implies capture to
some "log file".
Python's logging library enables messages to be formatted accordingly,
and directed differently, depending upon 'level of severity'. So, as
well as the flexibility mentioned before, there is an option to direct
logging output to stdout/stderr as a matter-of-course!
(and thus, today's user can have output to the screen, but if another
and less-capable user joins-the-club, his/her output could easily be
re-directed. On the other hand: YAGNI!)
--
Regards =dn
More information about the Python-list
mailing list