From 3fe81c747f94f8f03932801ead3a86b763afe812 Mon Sep 17 00:00:00 2001 From: Michael Kotliar Date: Fri, 27 Jul 2018 12:15:52 -0400 Subject: [PATCH] Update logger format --- cwl_airflow/main.py | 4 ++-- cwl_airflow/utils/logger.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cwl_airflow/main.py b/cwl_airflow/main.py index ec6e4d3..e344cd0 100755 --- a/cwl_airflow/main.py +++ b/cwl_airflow/main.py @@ -82,7 +82,7 @@ def arg_parser(): def run_demo_auto(args): run_demo_manual(args) start_background_scheduler() - logging.info("Run Airflow Webserver\n- {}".format(get_webserver_url())) + logging.info("Run Airflow Webserver in background\n- to open webserver follow the link {}".format(get_webserver_url())) with Mute(): webserver(get_airflow_default_args("webserver")) @@ -91,7 +91,7 @@ def run_demo_manual(args): clean_jobs_folder() workflows = get_demo_workflow() for idx, wf in enumerate(workflows): - logging.info("Demo workflow {}/{}".format(idx+1, len(workflows))) + logging.info("Process demo workflow {}/{}".format(idx+1, len(workflows))) submit_job(get_updated_args(args, wf)) diff --git a/cwl_airflow/utils/logger.py b/cwl_airflow/utils/logger.py index bca3f4a..e409f96 100644 --- a/cwl_airflow/utils/logger.py +++ b/cwl_airflow/utils/logger.py @@ -2,10 +2,13 @@ from airflow import settings +log_format = '[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s\n%(message)s' + + def reset_root_logger(quiet=None): for log_handler in logging.root.handlers: logging.root.removeHandler(log_handler) for log_filter in logging.root.filters: logging.root.removeFilter(log_filter) level = logging.WARN if quiet else settings.LOGGING_LEVEL - logging.basicConfig(level=level, format=settings.LOG_FORMAT) + logging.basicConfig(level=level, format=log_format)