OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
twisted
/
logger
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/31/2022 06:22:38 AM
rwxr-xr-x
📄
__init__.py
3.13 KB
09/08/2017 10:38:36 AM
rw-r--r--
📁
__pycache__
-
03/31/2022 06:22:39 AM
rwxr-xr-x
📄
_buffer.py
1.45 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_file.py
2.43 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_filter.py
6.83 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_flatten.py
4.97 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_format.py
8.22 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_global.py
8.43 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_io.py
4.35 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_json.py
9.83 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_legacy.py
5.11 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_levels.py
3.68 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_logger.py
9.03 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_observer.py
4.87 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_stdlib.py
4.3 KB
09/08/2017 10:38:36 AM
rw-r--r--
📄
_util.py
1.3 KB
09/08/2017 10:38:36 AM
rw-r--r--
📁
test
-
03/31/2022 06:22:38 AM
rwxr-xr-x
Editing: _util.py
Close
# -*- test-case-name: twisted.logger.test.test_util -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Logging utilities. """ def formatTrace(trace): """ Format a trace (that is, the contents of the C{log_trace} key of a log event) as a visual indication of the message's propagation through various observers. @param trace: the contents of the C{log_trace} key from an event. @type trace: object @return: A multi-line string with indentation and arrows indicating the flow of the message through various observers. @rtype: L{unicode} """ def formatWithName(obj): if hasattr(obj, "name"): return u"{0} ({1})".format(obj, obj.name) else: return u"{0}".format(obj) result = [] lineage = [] for parent, child in trace: if not lineage or lineage[-1] is not parent: if parent in lineage: while lineage[-1] is not parent: lineage.pop() else: if not lineage: result.append(u"{0}\n".format(formatWithName(parent))) lineage.append(parent) result.append(u" " * len(lineage)) result.append(u"-> {0}\n".format(formatWithName(child))) return u"".join(result)