Skip to content

Instantly share code, notes, and snippets.

@lu911
Created October 25, 2014 07:32
Show Gist options
  • Save lu911/b90be2d8f817cee66fa6 to your computer and use it in GitHub Desktop.
Save lu911/b90be2d8f817cee66fa6 to your computer and use it in GitHub Desktop.
def init_log(app):
import os
if not os.path.exists('logs'):
os.makedirs('logs')
import logging
logging.basicConfig(filename='logs/db.log')
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment