From 7cf0b881c194e99aa4cfc830f6e59d4219a6cb1b Mon Sep 17 00:00:00 2001 From: sergei Trofimov Date: Mon, 30 Apr 2018 11:58:37 +0100 Subject: [PATCH] fw: move version and cmd line logging to main() Move the logging of the WA version and command line used to invoke it from run command into main() inside entrypoint. That way, these will be the first entries in the log file, now that early log records are no longer lost. --- wa/commands/run.py | 1 - wa/framework/entrypoint.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wa/commands/run.py b/wa/commands/run.py index 791b1ade..7da32f96 100644 --- a/wa/commands/run.py +++ b/wa/commands/run.py @@ -24,7 +24,6 @@ from wa.framework import pluginloader from wa.framework.configuration.parsers import AgendaParser from wa.framework.execution import Executor from wa.framework.output import init_run_output -from wa.framework.version import get_wa_version from wa.framework.exception import NotFoundError, ConfigError from wa.utils import log from wa.utils.types import toggle_set diff --git a/wa/framework/entrypoint.py b/wa/framework/entrypoint.py index 5a8a4a44..b5cae903 100644 --- a/wa/framework/entrypoint.py +++ b/wa/framework/entrypoint.py @@ -26,6 +26,7 @@ from wa.framework.configuration import settings from wa.framework.configuration.execution import ConfigManager from wa.framework.host import init_user_directory, init_config from wa.framework.exception import ConfigError +from wa.framework.version import get_wa_version from wa.utils import log from wa.utils.doc import format_body @@ -94,6 +95,8 @@ def main(): args, _ = parser.parse_known_args(filtered_argv) settings.set("verbosity", args.verbose) log.init(settings.verbosity) + logger.debug('Version: {}'.format(get_wa_version())) + logger.debug('Command Line: {}'.format(' '.join(sys.argv))) # each command will add its own subparser commands = load_commands(parser.add_subparsers(dest='command'))