MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / _configure_library_root_logger

Function _configure_library_root_logger

bmtools/utils/logging.py:75–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73
74
75def _configure_library_root_logger() -> None:
76
77 global _default_handler
78
79 with _lock:
80 if _default_handler:
81 # This library has already configured the library root logger.
82 return
83 _default_handler = logging.StreamHandler() # Set sys.stderr as stream.
84 _default_handler.flush = sys.stderr.flush
85 formatter = logging.Formatter(
86 "\033[1;31m[%(levelname)s|(BMTools)%(module)s:%(lineno)d]%(asctime)s >> \033[0m %(message)s")
87 _default_handler.setFormatter(formatter)
88
89 # Apply our default configuration to the library root logger.
90 library_root_logger = _get_library_root_logger()
91 library_root_logger.addHandler(_default_handler)
92 library_root_logger.setLevel(_get_default_logging_level())
93
94
95 library_root_logger.propagate = False
96
97
98def _reset_library_root_logger() -> None:

Callers 9

get_verbosityFunction · 0.85
set_verbosityFunction · 0.85
disable_default_handlerFunction · 0.85
enable_default_handlerFunction · 0.85
add_handlerFunction · 0.85
remove_handlerFunction · 0.85
disable_propagationFunction · 0.85
enable_propagationFunction · 0.85
get_loggerFunction · 0.85

Calls 2

_get_library_root_loggerFunction · 0.85

Tested by

no test coverage detected