Skip to content

Commit

Permalink
Trim down the default amount of logging for planemo Galaxy instances.
Browse files Browse the repository at this point in the history
By default make every part of Galaxy except galaxy.tools.deps INFO, with tools.deps being DEBUG. Call planemo in ``--verbose`` mode to get more logging.

Fixes galaxyproject#515.
Fixes galaxyproject#275.
  • Loading branch information
jmchilton committed Feb 6, 2017
1 parent 4a398d5 commit 6135cd2
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion planemo/galaxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,50 @@
</job_conf>
"""

LOGGING_TEMPLATE = """
## Configure Python loggers.
[loggers]
keys = root,galaxydeps,galaxy
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = WARN
handlers = console
[logger_paste]
level = WARN
handlers = console
qualname = paste
propagate = 0
[logger_galaxydeps]
level = DEBUG
handlers = console
qualname = galaxy.tools.deps
propagate = 0
[logger_galaxy]
level = ${log_level}
handlers = console
qualname = galaxy
propagate = 0
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = DEBUG
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s
"""


# Provide some shortcuts for simple/common dependency resolutions strategies.
STOCK_DEPENDENCY_RESOLUTION_STRATEGIES = {
Expand Down Expand Up @@ -364,7 +408,7 @@ def config_join(*args):
tool_conf=tool_conf,
debug=kwds.get("debug", "true"),
id_secret=kwds.get("id_secret", "test_secret"),
log_level=kwds.get("log_level", "DEBUG"),
log_level="DEBUG" if ctx.verbose else "INFO",
)
tool_config_file = "%s,%s" % (tool_conf, shed_tool_conf)
# Setup both galaxy_email and older test user test@bx.psu.edu
Expand Down Expand Up @@ -404,6 +448,7 @@ def config_join(*args):
test_data_dir=test_data_dir, # TODO: make gx respect this
))
_handle_container_resolution(ctx, kwds, properties)
write_file(config_join("logging.ini"), _sub(LOGGING_TEMPLATE, template_args))
if not for_tests:
properties["database_connection"] = _database_connection(database_location, **kwds)

Expand All @@ -430,6 +475,7 @@ def config_join(*args):
if preseeded_database:
env["GALAXY_TEST_DB_TEMPLATE"] = os.path.abspath(database_location)
env["GALAXY_TEST_UPLOAD_ASYNC"] = "false"
env["GALAXY_TEST_LOGGING_CONFIG"] = config_join("logging.ini")
env["GALAXY_DEVELOPMENT_ENVIRONMENT"] = "1"
web_config = _sub(WEB_SERVER_CONFIG_TEMPLATE, template_args)
write_file(config_join("galaxy.ini"), web_config)
Expand Down

0 comments on commit 6135cd2

Please sign in to comment.