Last active
September 1, 2015 05:53
-
-
Save wwj718/f40f0572c6e099073238 to your computer and use it in GitHub Desktop.
日志
This file contains 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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import logging | |
LOG_FILE = "log_file.log" | |
#logging.basicConfig(filename=LOG_FILE,level=logging.DEBUG) | |
logger = logging.getLogger(__name__) | |
handler=logging.FileHandler(LOG_FILE) | |
logger.addHandler(handler) | |
logger.setLevel(logging.DEBUG) | |
logger.debug("this is an debug message") | |
logger.info("This is an info message") | |
logger.warning("This is a warning message") | |
logger.error("This is an error message") | |
logger.critical("This is a critical message") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment