Skip to content

Commit

Permalink
replace print statements with logger
Browse files Browse the repository at this point in the history
  • Loading branch information
opalmer committed Nov 25, 2014
1 parent 9f171e0 commit 264c9c9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pyfarm/master/entrypoints.py
Expand Up @@ -38,6 +38,7 @@
from flask.ext.admin.base import MenuLink

from pyfarm.core.config import read_env_bool
from pyfarm.core.logger import getLogger
from pyfarm.master.application import db, app
from pyfarm.master.utility import error_handler

Expand All @@ -58,6 +59,8 @@
from pyfarm.models.pathmap import PathMap
from pyfarm.models.tasklog import TaskLog

logger = getLogger("master.entrypoints")


def load_before_first(app_instance, database_instance):
if app_instance.debug:
Expand Down Expand Up @@ -563,7 +566,7 @@ def tables(): # pragma: no cover
db.engine.echo = args.echo

if db.engine.name == "sqlite" and db.engine.url.database == ":memory:":
print("Nothing to do, in memory sqlite database is being used")
logger.info("Nothing to do, in memory sqlite database is being used")
return

if args.drop_all:
Expand All @@ -573,11 +576,11 @@ def tables(): # pragma: no cover
try:
db.create_all()
except Exception as e:
print("Failed to call create_all(). This may be an error or "
"it may be something that can be ignored: %r" % e)
logger.error(
"Failed to call create_all(). This may be an error or "
"it may be something that can be ignored: %r", e)
else:
print()
print("Tables created or updated")
logger.info("Tables created or updated")


def run_master(): # pragma: no cover
Expand Down

0 comments on commit 264c9c9

Please sign in to comment.