remove janky logger monkey patch

This commit is contained in:
forest 2021-01-04 17:20:30 -06:00
parent d82aa99c40
commit e9d6230c69

View File

@ -107,45 +107,6 @@ logging_dict_config({
}
})
# class LoggerWhichLogsHeartbeatInfoMessagesAtDebugLevel(logging.Logger):
# def isHeartbeatRelatedString(self, thing):
# # thing_string = "<error>"
# is_in_string = False
# try:
# thing_string = "%s" % thing
# is_in_string = 'heartbeat-task' in thing_string or 'hub/heartbeat' in thing_string or 'spoke/heartbeat' in thing_string
# except:
# pass
# # self.warning("isHeartbeatRelatedString(%s): %s", thing_string, is_in_string )
# return is_in_string
# def info(self, msg, *args, **kwargs):
# log_level_to_use = logging.INFO
# if self.isHeartbeatRelatedString(msg):
# log_level_to_use = logging.DEBUG
# for arg in args:
# if self.isHeartbeatRelatedString(arg):
# log_level_to_use = logging.DEBUG
# self._log(log_level_to_use, msg, args, **kwargs)
# def monkeyPatchLoggerToLogHeartbeatInfoMessagesAtDebugLevel(name: str):
# logger = logging.getLogger(name)
# original_info = logger.info
# logger.__class__ = LoggerWhichLogsHeartbeatInfoMessagesAtDebugLevel
# logger.unfiltered_info = original_info
# monkeyPatchLoggerToLogHeartbeatInfoMessagesAtDebugLevel('flask')
# monkeyPatchLoggerToLogHeartbeatInfoMessagesAtDebugLevel('werkzeug')
# # monkeyPatchLoggerToLogHeartbeatInfoMessagesAtDebugLevel('apscheduler.scheduler')
# monkeyPatchLoggerToLogHeartbeatInfoMessagesAtDebugLevel('apscheduler.executors')
# monkeyPatchLoggerToLogHeartbeatInfoMessagesAtDebugLevel('apscheduler.executors.default')
# # monkeyPatchLoggerToLogHeartbeatInfoMessagesAtDebugLevel('apscheduler.jobstores.default')
#monkeyPatchLoggerToLogInfoMessagesAtDebugLevel('apscheduler.executors.asyncio')
# app.logger.critical("critical")
# app.logger.error("error")
# app.logger.warning("warning")