get_logger#
- ansys.dynamicreporting.core.adr_utils.get_logger(logfile: str | PathLike[str] | None = None, *, log_output: str | PathLike[str] | None = None, log_level: int | str | None = None) Logger#
Return the
ansys.dynamicreporting.corepackage logger.ADR uses its own logger and does not change the root logger. By default ADR adds a
NullHandlerand leaves the logging level unchanged. Passlog_outputto add a file or stdout handler, and passlog_levelto set the shared ADR logger’s level explicitly.- Parameters:
- logfile
stroros.PathLike,optional Deprecated alias for
log_output. Passing it emitsDeprecationWarning.- log_output
stroros.PathLike,optional Where to send ADR logs.
"stdout"writes to standard output. Any other value is used as a file path.Noneadds no output handler.- log_level
intorstr,optional Level for the shared ADR logger.
Noneleaves its current level unchanged.
- logfile
- Returns:
logging.LoggerThe
ansys.dynamicreporting.corepackage logger.
- Raises:
ValueErrorIf both
logfileandlog_outputare provided.
Notes
Repeated calls do not add duplicate ADR-owned handlers for the same standard-output stream or normalized file path.