mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-30 12:46:11 -04:00
21 lines
362 B
Python
21 lines
362 B
Python
#!/usr/bin/env python
|
|
|
|
__author__ = "bt3"
|
|
|
|
import logging
|
|
|
|
LOG_FILENAME = 'logging_example.out'
|
|
logging.basicConfig(filename=LOG_FILENAME,
|
|
level=logging.DEBUG,
|
|
)
|
|
|
|
logging.debug('This message should go to the log file')
|
|
|
|
f = open(LOG_FILENAME, 'rt')
|
|
try:
|
|
body = f.read()
|
|
finally:
|
|
f.close()
|
|
|
|
print 'FILE:'
|
|
print body |