molsysmt.config package#
Submodules#
molsysmt.config.logging_setup module#
- molsysmt.config.logging_setup.setup_logging(level='WARNING', *, stream=None, capture_warnings=True, simplify_warning_format=True, logger_name='molsysmt')[source]#
Configure MolSysMT logging and (optionally) capture Python warnings.
Effects#
Creates/gets logger logger_name (default: “molsysmt”)
- Attaches a StreamHandler if not present, with formatter:
“MOLSYSMT %(levelname)s | %(message)s”
- If capture_warnings is True:
logging.captureWarnings(True)
The “py.warnings” logger reuses the same handler/formatter
- If simplify_warning_format is True:
warnings.formatwarning(message, category, filename, lineno, line=None) -> “CategoryName: messagen”
(i.e., removes ‘filename:lineno’ prefix)
- Parameters:
level (int | str)
stream (IO | None)
capture_warnings (bool)
simplify_warning_format (bool)
logger_name (str)
- Return type:
Logger