1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-27 00:57:47 +08:00

updated dump_stack uses logging handler function

This commit is contained in:
Joel Bender
2018-03-19 16:09:43 -04:00
parent fe0f184993
commit afb882bad9
2 changed files with 6 additions and 6 deletions

View File

@@ -52,10 +52,10 @@ bacpypes_debugging(stop)
# dump_stack
#
def dump_stack():
if _debug: dump_stack._debug("dump_stack")
def dump_stack(debug_handler):
if _debug: dump_stack._debug("dump_stack %r", debug_handler)
for filename, lineno, fn, _ in traceback.extract_stack()[:-1]:
sys.stderr.write(" %-20s %s:%s\n" % (fn, filename.split('/')[-1], lineno))
debug_handler(" %-20s %s:%s", fn, filename.split('/')[-1], lineno)
bacpypes_debugging(dump_stack)