Created
February 27, 2016 02:56
-
-
Save TearTheSky/b26ec138e9d8f6475559 to your computer and use it in GitHub Desktop.
Pythonで、LTSV形式でログを出力するサンプル。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import datetime | |
logging.basicConfig(level=logging.DEBUG, | |
format="time:%(asctime)s \tseverity:[%(levelname)s] \tmessage:%(message)s ", filename='myapp.log') | |
logging.debug('This message should go to the log file') | |
logging.info('So should this') | |
logging.warning('And this, too') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment