From fea4326637f5a3aa020a7f1424acb0b5681451c9 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Mon, 20 Apr 2020 15:12:18 +0800 Subject: [PATCH] fix logger propagate. test=develop. test=release/2.0 (#23983) --- python/paddle/fluid/log_helper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/paddle/fluid/log_helper.py b/python/paddle/fluid/log_helper.py index ab20ed4c48c..a7617c8f62a 100644 --- a/python/paddle/fluid/log_helper.py +++ b/python/paddle/fluid/log_helper.py @@ -49,4 +49,8 @@ def get_logger(name, level, fmt=None): handler.setFormatter(formatter) logger.addHandler(handler) + + # stop propagate for propagating may print + # log multiple times + logger.propagate = False return logger -- GitLab