drugex.logs package
Submodules
drugex.logs.config module
- class drugex.logs.config.LevelFilter(level)[source]
Bases:
Filter
LoggingFilter used to filter one or more specific log levels messages
- class drugex.logs.config.LevelFormatter(formats: Dict[int, str], **kwargs)[source]
Bases:
Formatter
LoggingFormatter used to specifiy the formatting per level
- format(record: LogRecord) str [source]
Format the specified record as text.
The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.
- drugex.logs.config.config_logger(log_file_path, debug=None, disable_existing_loggers=True)[source]
Function to configure the logging. All info is saved in a simple format on the log file path. Debug entries are saved to a separate file if debug is True Debug and warning and above are save in a verbose format. Warning and above are also printed to std.out …
- Parameters:
(str) (log_file_path) –
(bool) (no_exist_log) –
(bool) –
- drugex.logs.config.get_git_info()[source]
Get information of the current git commit
If the package is installed with pip, read detailed version extracted by setuptools_scm. Otherwise, use gitpython to get the information from the git repo.
drugex.logs.utils module
utils
Created by: Martin Sicho On: 17.05.22, 9:55
- drugex.logs.utils.backUpFiles(base_dir: str, folder: str, output_prefixes: tuple, cp_suffix=None)[source]
- drugex.logs.utils.backUpFilesInFolder(_dir, backup_id, output_prefixes, output_extensions='dummy', cp_suffix=None)[source]
- drugex.logs.utils.enable_file_logger(log_folder, filename, debug=False, log_name=None, git_hash=None, init_data=None, disable_existing_loggers=True)[source]
Module contents
__init__.py
Created by: Martin Sicho On: 17.05.22, 9:53