Skip to content

Commit

Permalink
Move logging setup to __init__.py so it's always available
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Mar 18, 2014
1 parent c7ded66 commit caa1989
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,4 @@ def delete(email):
manager.add_command("import", import_manager)

if __name__ == '__main__':
channel = logging.StreamHandler()
logging.getLogger().addHandler(channel)
logging.getLogger().setLevel(settings.LOG_LEVEL)

manager.run()
4 changes: 0 additions & 4 deletions migrations/create_data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
from redash import settings

if __name__ == '__main__':
channel = logging.StreamHandler()
logging.getLogger().addHandler(channel)
logging.getLogger().setLevel(settings.LOG_LEVEL)

db.connect_db()

if not models.DataSource.table_exists():
Expand Down
4 changes: 4 additions & 0 deletions redash/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import urlparse
import logging
from flask import Flask, make_response
from flask.ext.restful import Api
from flask_peewee.db import Database
Expand All @@ -10,6 +11,9 @@

__version__ = '0.3.5'

logging.getLogger().addHandler(logging.StreamHandler())
logging.getLogger().setLevel(settings.LOG_LEVEL)

app = Flask(__name__,
template_folder=settings.STATIC_ASSETS_PATH,
static_folder=settings.STATIC_ASSETS_PATH,
Expand Down

0 comments on commit caa1989

Please sign in to comment.