Skip to content

Instantly share code, notes, and snippets.

@doobeh
Created January 28, 2013 15:47
Show Gist options
  • Select an option

  • Save doobeh/4656606 to your computer and use it in GitHub Desktop.

Select an option

Save doobeh/4656606 to your computer and use it in GitHub Desktop.
Heroku Logging Quickie
handler = logging.StreamHandler(sys.stdout)
handler.setLevel(logging.DEBUG)
handler.setFormatter(logging.Formatter(
'%(asctime)s %(levelname)s: %(message)s '
'[in %(pathname)s:%(lineno)d]'
))
app.logger.addHandler(handler)
app.logger.info('Testing Info Level')
app.logger.debug('Testing Debug Level')
app.logger.warning('Testing Warning Level')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment