Skip to content

Instantly share code, notes, and snippets.

@dnozay
Last active December 20, 2015 00:19
Show Gist options
  • Save dnozay/6040705 to your computer and use it in GitHub Desktop.
Save dnozay/6040705 to your computer and use it in GitHub Desktop.
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