Skip to content

Commit

Permalink
Update logger format
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-kotliar committed Jul 27, 2018
1 parent dd1faf2 commit 3fe81c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cwl_airflow/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand All @@ -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))


Expand Down
5 changes: 4 additions & 1 deletion cwl_airflow/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 3fe81c7

Please sign in to comment.