Created
August 13, 2010 21:23
-
-
Save gregglind/523567 to your computer and use it in GitHub Desktop.
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 | |
logging.basicConfig(level=logging.ERROR, format='%(asctime)s %(levelname)s %(name)s %(message)s') | |
logger = logging.getLogger({"__main__":None}.get(__name__, __name__)) | |
import unittest, nose | |
def test_log(): | |
print "level", logger.getEffectiveLevel() | |
logger.debug("debug") | |
logger.info("info") | |
logger.warn("warn") | |
logger.error("error") | |
logger.critical("critical") | |
raise ValueError | |
def test_log2(): | |
print "level", logger.getEffectiveLevel() | |
logger.debug("debug") | |
logger.info("info") | |
logger.warn("warn") | |
logger.error("error") | |
logger.critical("critical") | |
#nose.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment