MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / filter

Method filter

openhands/app_server/utils/logger.py:97–110  ·  view source on GitHub ↗
(self, record: logging.LogRecord)

Source from the content-addressed store, hash-verified

95
96class StackInfoFilter(logging.Filter):
97 def filter(self, record: logging.LogRecord) -> bool:
98 if record.levelno >= logging.ERROR:
99 # Only add stack trace info if there's an actual exception
100 exc_info = sys.exc_info()
101 if exc_info and exc_info[0] is not None:
102 # Capture the current stack trace as a string
103 stack = traceback.format_stack()
104 # Remove the last entries which are related to the logging machinery
105 stack = stack[:-3] # Adjust this number if needed
106 # Join the stack frames into a single string
107 stack_str = ''.join(stack)
108 setattr(record, 'stack_info', stack_str)
109 setattr(record, 'exc_info', exc_info)
110 return True
111
112
113class NoColorFormatter(logging.Formatter):

Callers 15

AccordionFunction · 0.45
OptionFunction · 0.45
resolveMainClientFunction · 0.45
passthroughFunction · 0.45
sendToClientFunction · 0.45
PluginLaunchModalFunction · 0.45
ArchivedConversationViewFunction · 0.45
handleTabClickFunction · 0.45
ConversationTabsFunction · 0.45
UsageDashboardFunction · 0.45
AreaChartFunction · 0.45

Calls

no outgoing calls

Tested by 1

getNavItemsFunction · 0.36