MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / ScriptLogHandler

Class ScriptLogHandler

examples/create_team.py:28–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27# Keeper Commander uses logging module to communicate with the user.
28class ScriptLogHandler(logging.Handler):
29 def __init__(self):
30 super(ScriptLogHandler, self).__init__()
31 self.errors = []
32
33 def emit(self, record: LogRecord) -> None:
34 message = record.msg % record.args
35 self.errors.append(message)
36
37 def clear_errors(self):
38 self.errors.clear()
39
40 def has_error(self):
41 return len(self.errors) > 0
42
43# Configure logging
44slh = ScriptLogHandler()

Callers 1

create_team.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected