Skip to content

Instantly share code, notes, and snippets.

@TearTheSky
Created February 27, 2016 02:56
Show Gist options
  • Save TearTheSky/b26ec138e9d8f6475559 to your computer and use it in GitHub Desktop.
Save TearTheSky/b26ec138e9d8f6475559 to your computer and use it in GitHub Desktop.
Pythonで、LTSV形式でログを出力するサンプル。
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