From 7b369e06289162afe1ebadbffa4377a9416b44a0 Mon Sep 17 00:00:00 2001 From: "q.yao" Date: Mon, 22 Nov 2021 20:41:17 +0800 Subject: [PATCH] Update log format (#203) --- tools/deploy.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/deploy.py b/tools/deploy.py index 3c04d3c2d..ad56e7e17 100644 --- a/tools/deploy.py +++ b/tools/deploy.py @@ -50,6 +50,10 @@ def parse_args(): def target_wrapper(target, log_level, ret_value, *args, **kwargs): logger = logging.getLogger() + logging.basicConfig( + format='%(asctime)s,%(msecs)d %(levelname)-8s' + ' [%(filename)s:%(lineno)d] %(message)s', + datefmt='%Y-%m-%d:%H:%M:%S') logger.level logger.setLevel(log_level) if ret_value is not None: @@ -85,7 +89,10 @@ def create_process(name, target, args, kwargs, ret_value=None): def main(): args = parse_args() set_start_method('spawn') - + logging.basicConfig( + format='%(asctime)s,%(msecs)d %(levelname)-8s' + ' [%(filename)s:%(lineno)d] %(message)s', + datefmt='%Y-%m-%d:%H:%M:%S') logger = logging.getLogger() logger.setLevel(args.log_level)