未验证 提交 824c4ef9 编写于 作者: K kuizhiqing 提交者: GitHub

avoid setting logging.basicConfig (#37031) (#37530)

上级 89fb1964
......@@ -20,8 +20,13 @@ import logging
import signal
import random
logging.basicConfig(level=os.environ.get('LOGLEVEL', 'INFO').upper())
logger = logging.getLogger("ELASTIC")
logger.setLevel(logging.INFO)
formatter = logging.Formatter(
fmt='%(name)s %(levelname)s %(asctime)s %(message)s')
ch = logging.StreamHandler()
ch.setFormatter(formatter)
logger.addHandler(ch)
ELASTIC_EXIT_CODE = 101
......
......@@ -42,9 +42,12 @@ FLEET_GLOBAL_DICT = {
"scale_sparse_grad": None,
}
logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
formatter = logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(message)s')
ch = logging.StreamHandler()
ch.setFormatter(formatter)
logger.addHandler(ch)
class DistributedOptimizerImplBase(object):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册