Logging
Logging.
- mdacli.logger.check_suffix(filename: str | Path, suffix: str) str | Path[source]
Check the suffix of a file name and adds if it not existing.
If
filenamedoes not end withsuffixthesuffixis added and a warning will be issued.- Parameters:
filename (Name of the file to be checked.)
suffix (Expected file suffix i.e.
.txt.)
- Returns:
Checked and probably extended file name.
- mdacli.logger.setup_logging(logobj: Logger, logfile: str | Path | None = None, level: int = 30)[source]
Create a logging environment for a given
log_obj.- Parameters:
logobj (
logging.Logger) – A logging instancelogfile (str) – Name of the log file
level (int) – Set the root logger level to the specified level. If for example set to
logging.DEBUGdetailed debug logs inludcing filename and function name are displayed. Forlogging.INFOonly the message logged from errors, warnings and infos will be displayed.