onnxruntime/tools/python/util/logger.py
Bowen Bao 152e61da37
Avoid get_logger overriding root logger level (#17569)
### Description
Instead, set level to DEBUG for the logger returned.



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

Otherwise, this function call overrides root logger level setting, which
affects logging facility of other python packages.
2023-09-19 10:42:27 -07:00

11 lines
309 B
Python

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import logging
def get_logger(name):
logging.basicConfig(format="%(asctime)s %(name)s [%(levelname)s] - %(message)s")
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
return logger