Skip to content

Commit

Permalink
Make app logging init optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Aug 28, 2020
1 parent 86f4b12 commit 8f155a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ docs/_build
build/
dist/
error.log
error.log.*
__pycache__
.pytest_cache
.cache
Expand Down
6 changes: 4 additions & 2 deletions coaster/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def create_jinja_environment(self):
return rv


def init_app(app):
def init_app(app, init_logging=True):
"""
Configure an app depending on the environment. Loads settings from a file
named ``settings.py`` in the instance folder, followed by additional
Expand All @@ -160,6 +160,7 @@ def init_app(app):
:func:`coaster.logger.init_app`.
:param app: App to be configured
:param bool init_logging: Call `coaster.logger.init_app` (default `True`)
"""
# Make current_auth available to app templates
app.jinja_env.globals['current_auth'] = current_auth
Expand All @@ -180,7 +181,8 @@ def init_app(app):
if additional:
load_config_from_file(app, additional)

logger.init_app(app)
if init_logging:
logger.init_app(app)


def load_config_from_file(app, filepath):
Expand Down

0 comments on commit 8f155a9

Please sign in to comment.