Last active
December 20, 2015 00:19
-
-
Save dnozay/6040705 to your computer and use it in GitHub Desktop.
counter example to http://stackoverflow.com/a/17710275/1733117
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
import logging | |
LOG_MODULE_NAME = logging.getLogger(__name__) | |
def DEBUG(msg): | |
global LOG_MODULE_NAME | |
LOG_MODULE_NAME.debug(msg) | |
def foo(): | |
DEBUG('oh hai, this should be line 9') | |
if __name__ == '__main__': | |
logging.basicConfig(format="[%(filename)s %(lineno)s] %(message)s") | |
logging.root.setLevel(logging.DEBUG) | |
DEBUG('ok, this should be line 14') | |
foo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment