enpt.utils package
Submodules
enpt.utils.logging module
EnPT logging module containing logging related classes and functions.
- class enpt.utils.logging.EnPT_Logger(name_logfile: str, fmt_suffix: any = None, path_logfile: str = None, log_level: any = 'INFO', append: bool = True)[source]
Bases:
Logger
Class for the EnPT logger.
Return a logging.logger instance pointing to the given logfile path.
- Parameters:
name_logfile –
fmt_suffix – if given, it will be included into log formatter
path_logfile – if no path is given, only a StreamHandler is created
log_level – the logging level to be used (choices: ‘DEBUG’, ‘INFO’, ‘WARNING’, ‘ERROR’, ‘CRITICAL’; default: ‘INFO’)
append – <bool> whether to append the log message to an existing logfile (1) or to create a new logfile (0); default=1
- property captured_stream: str
Return the already captured logging stream.
- NOTE:
- set self.captured_stream:
self.captured_stream = ‘any string’
- class enpt.utils.logging.LessThanFilter(exclusive_maximum, name='')[source]
Bases:
Filter
Filter class to filter log messages by a maximum log level.
- Based on http://stackoverflow.com/questions/2302315/
how-can-info-and-debug-logging-message-be-sent-to-stdout-and-higher-level-messag
Get an instance of LessThanFilter.
- Parameters:
exclusive_maximum – maximum log level, e.g., logger.WARNING
name –
enpt.utils.path_generator module
EnPT path generator module for generating file paths for all kinds of EnMAP images.
Module contents
EnPT ‘utils’ module containing utilities that are used in the whole EnPT package.