Skip to content

Commit

Permalink
Merge pull request #400 from lyrixderaven/master
Browse files Browse the repository at this point in the history
Init logging for commands
  • Loading branch information
dnouri committed Feb 21, 2015
2 parents 639d22b + c65dfbd commit af0da69
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kotti/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from pyramid.interfaces import ITranslationDirectories
from pyramid.location import inside
from pyramid.paster import bootstrap
from pyramid.paster import setup_logging
from pyramid.renderers import render
from pyramid.threadlocal import get_current_registry
from pyramid.threadlocal import get_current_request
Expand Down Expand Up @@ -365,7 +366,11 @@ def camel_case_to_name(text):

def command(func, doc):
args = docopt(doc)
pyramid_env = bootstrap(args['<config_uri>'])
# establish config file uri
config_uri = args['<config_uri>']
pyramid_env = bootstrap(config_uri)
# Setup logging to allow log output from command methods
setup_logging(config_uri)
try:
func(args)
finally:
Expand Down

0 comments on commit af0da69

Please sign in to comment.