MCPcopy Create free account
hub / github.com/blacklanternsecurity/bbot / run

Method run

bbot/core/helpers/process.py:35–53  ·  view source on GitHub ↗

A version of Process.run() with BBOT logging and better error handling

(self)

Source from the content-addressed store, hash-verified

33 self.daemon = True
34
35 def run(self):
36 """
37 A version of Process.run() with BBOT logging and better error handling
38 """
39 log = logging.getLogger("bbot.core.process")
40 try:
41 if self.log_level is not None and self.log_queue is not None:
42 from bbot.core import CORE
43
44 CORE.logger.setup_queue_handler(self.log_queue, self.log_level)
45 if self.custom_name:
46 from setproctitle import setproctitle
47
48 setproctitle(str(self.custom_name))
49 super().run()
50 except BaseException as e:
51 if not in_exception_chain(e, (KeyboardInterrupt,)):
52 log.warning(f"Error in {self.name}: {e}")
53 log.trace(traceback.format_exc())

Callers

nothing calls this directly

Calls 5

in_exception_chainFunction · 0.85
setup_queue_handlerMethod · 0.80
runMethod · 0.45
warningMethod · 0.45
traceMethod · 0.45

Tested by

no test coverage detected