[issue8890] Module logging has dangerous examples
anatoly techtonik <techtonik@gmail.com> added the comment: import logging - LOG_FILENAME = '/tmp/logging_example.out' + LOG_FILENAME = 'example.log' logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG) logging.debug('This message should go to the log file') ---------- nosy: +techtonik _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8890> _______________________________________
Éric Araujo <merwok@netwok.org> added the comment: Nice, this example doesn’t require explaining tempfile and is shorter. Add a notice before the code that you need to be in a directory with write rights for this to work and I’m +1. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8890> _______________________________________
participants (2)
-
anatoly techtonik
-
Éric Araujo