()
Configure the logger.
Configure the logger.
Configure the logger .
def configure_logger():
    """Configure the logger."""
    class NoESFilter(logging.Filter):
        """Custom filter to filter out ES logs"""
        def filter(self, record):
            """Filter out records."""
            return not record.name.lower() == 'opensearch'

    logger_formatter = logging.Formatter(
        '[%(asctime)s] %(name)s/%(levelname)s %(message)s')
    logger_filter = NoESFilter()
    logger_object = logging.getLogger('timesketch')

    for handler in logger_object.parent.handlers:
        handler.setFormatter(logger_formatter)
        handler.addFilter(logger_filter)
def configure_logger ( ) : class NoESFilter ( logging . Filter ) : """Custom filter to filter out ES logs""" def filter ( self , record ) : """Filter out records.""" return not record . name . lower ( ) == 'opensearch' logger_formatter = logging . Formatter ( '[%(asctime)s] %(name)s/%(levelname)s %(message)s' ) logger_filter = NoESFilter ( ) logger_object = logging . getLogger ( 'timesketch' ) for handler in logger_object . parent . handlers : handler . setFormatter ( logger_formatter ) handler . addFilter ( logger_filter )