1.2.4. tds2stac.logger module#
- class tds2stac.logger.Logger(logger_properties: dict[str, Any] | None = {})[source]#
Bases:
objectA class-based logger for TDS2STAC. It supports all the handlers from the standard python logging library.
- Parameters:
logger_properties (dict, optional) –
Logger properties. Defaults to
dict(). It’s optional and has the following keys:logger_msg (str, optional)
logger_handler (str, optional)
logger_name (str, optional)
logger_id (str, optional)
logger_level (str, optional)
logger_formatter (str, optional)
logger_handler_host (str, optional)
logger_handler_port (str, optional)
logger_handler_url (str, optional)
logger_handler_method (str, optional)
logger_handler_secure (bool, optional)
logger_handler_credentials (tuple, optional)
logger_handler_context (tuple, optional)
logger_handler_filename (str, optional)
logger_handler_mode (str, optional)
logger_handler_encoding (str, optional)
logger_handler_delay (bool, optional)
logger_handler_errors (str, optional)
logger_handler_mailhost (str, optional)
logger_handler_fromaddr (str, optional)
logger_handler_toaddrs (str, optional)
logger_handler_subject (str, optional)
logger_handler_timeout (str, optional)
- logger_properties: dict[str, Any] | None#
A dictionary that contains all the logger properties.
It is optional and it is set to
Noneby default. The following keys are supported:- logger_msg (str, optional):
Logger message. Defaults to
None. But it is required when you want to log a message.- logger_handler (str, optional):
Logger handler. Defaults to
NullHandler. Check the following website for more information:https://docs.python.org/3/library/logging.handlers.html#module-logging.handlers
- logger_name (str, optional):
Logger name. Defaults to
INSUPDEL4STAC. It’s required when you chooseHTTPHandleras logger_handler.- logger_id (str, optional):
Logger id. Defaults to
1. It’s required when you chooseHTTPHandleras logger_handler.- logger_level (str, optional):
Logger level. Defaults to
DEBUG. It’s optional. For more information check the following website:- logger_formatter (str, optional):
Logger format. Defaults to
%(levelname)-8s %(asctime)s t %(filename)s @function %(funcName)s line %(lineno)s - %(message)s. For more information check the following website:https://docs.python.org/3/library/logging.html#formatter-objects
- logger_handler_host (str, optional):
Logger host. Sets the value to ‘None’ by default. It is required when
HTTPHandlerorSocketHandlerare selected as thelogger_handler. Thelogger_handlerwill be set to ‘NullHandler’ ifHTTPHandlerorSocketHandleris selected as thelogger_handlervalue and neitherlogger_handler_hostnorlogger_handler_portnor are specified.- logger_handler_port (str, optional):
Logger port. Sets the value to ‘None’ by default. It is required when
HTTPHandlerorSocketHandlerare selected as thelogger_handler. Thelogger_handlerwill be set to ‘NullHandler’ ifHTTPHandlerorSocketHandleris selected as thelogger_handlervalue and neitherlogger_handler_hostnorlogger_handler_portare specified.- logger_handler_url (str, optional):
Logger url. Sets the value to ‘None’ by default. It is required when
HTTPHandleris selected as thelogger_handler. Thelogger_handlerwill be set to ‘NullHandler’ ifHTTPHandleris selected as thelogger_handlervalue and neitherlogger_handler_urlis specified.- logger_handler_method (str, optional):
HTTP methods. It supports sending logging messages to a web server, using either GET or POST semantics. Sets the value to ‘None’ by default. It is required when
HTTPHandleris selected as thelogger_handler. Thelogger_handlerwill be set to ‘NullHandler’ ifHTTPHandleris selected as thelogger_handlervalue andlogger_handler_methodis not specified.- logger_handler_secure (bool, optional):
HTTP secure. Sets the value to ‘False’ by default. It is utilized when
HTTPHandlerorSMTPHandlerare selected as thelogger_handler. But it is optional in both logger handlers.- logger_handler_credentials (tuple, optional):
HTTP credentials. Sets the value to ‘None’ by default. It is utilized when
HTTPHandlerorSMTPHandlerare selected as thelogger_handler. But it is optional in both logger handlers.- logger_handler_context (tuple, optional):
HTTP context. Sets the value to ‘None’ by default. It is utilized when
HTTPHandleris selected as thelogger_handler. But it is optional in both logger handlers.- logger_handler_filename (str, optional):
File name. Sets the value to ‘None’ by default. It is required when
FileHandlerorWatchedFileHandlerare selected as thelogger_handler. Thelogger_handlerwill be set to ‘NullHandler’ ifFileHandlerorWatchedFileHandleris selected as thelogger_handlervalue andlogger_handler_filenameis not specified.- logger_handler_mode (str, optional):
File mode. Sets the value to ‘None’ by default. It is required when
FileHandlerorWatchedFileHandlerare selected as thelogger_handler. Thelogger_handlerwill be set to ‘NullHandler’ ifFileHandlerorWatchedFileHandleris selected as thelogger_handlervalue andlogger_handler_modeis not specified.- logger_handler_encoding (str, optional):
File encoding. Sets the value to ‘None’ by default. It is utilized when
FileHandlerorWatchedFileHandlerare selected as thelogger_handler. But it is optional in both logger handlers.- logger_handler_delay (bool, optional):
File delay. Sets the value to ‘False’ by default. It is utilized when
FileHandlerorWatchedFileHandlerare selected as thelogger_handler. But it is optional in both logger handlers.- logger_handler_errors (str, optional):
File errors. Sets the value to ‘None’ by default. It is utilized when
FileHandlerorWatchedFileHandlerare selected as thelogger_handler. But it is optional in both logger handlers.- logger_handler_mailhost (str, optional):
Mail host. Sets the value to ‘None’ by default. It is required when
SMTPHandleris selected as thelogger_handler. Thelogger_handlerwill be set to ‘NullHandler’ ifSMTPHandleris selected as thelogger_handlervalue andlogger_handler_mailhostis not specified.- logger_handler_fromaddr (str, optional):
Mail from address. Sets the value to ‘None’ by default. It is required when
SMTPHandleris selected as thelogger_handler. Thelogger_handlerwill be set to ‘NullHandler’ ifSMTPHandleris selected as thelogger_handlervalue andlogger_handler_fromaddris not specified.- logger_handler_toaddrs (str, optional):
Mail to address. Sets the value to ‘None’ by default. It is required when
SMTPHandleris selected as thelogger_handler. Thelogger_handlerwill be set to ‘NullHandler’ ifSMTPHandleris selected as thelogger_handlervalue andlogger_handler_toaddrsis not specified.- logger_handler_subject (str, optional):
Mail subject. Sets the value to ‘None’ by default. It is utilized when
SMTPHandleris selected as thelogger_handler. But it is optional in both logger handlers.- logger_handler_timeout (str, optional):
Mail timeout. Sets the value to ‘None’ by default. It is utilized when
SMTPHandleris selected as thelogger_handler. But it is optional in both logger handlers.