I've been playing with the logging module - long overdue!
I started with the basic tutorial but fell at the first hurdle.
It says to specify a file in the logging.basicConfig() function then
asks you to open the file after logging some events.
But I can't find the file anywhere...
Here's my code:
>>> import logging
>>> logging.basicConfig(file='./log.txt', level=logging.DEBUG)
>>> logging.info('some stuff')
INFO:root:some stuff
>>> logging.error('Somethings burning')
ERROR:root:Somethings burning
>>> logging.critical('I warned you!')
CRITICAL:root:I warned you!
>>>
But if I exit Python there is no file called log.txt
that I can find either in the current folder or in my
home folder. The tutorial seems to suggest it
should be obvious...
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor