Skip to content

Commit

Permalink
Update log format (open-mmlab#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
grimoire authored Nov 22, 2021
1 parent 417a2a0 commit 7b369e0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 7b369e0

Please sign in to comment.