__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# -*- test-case-name: twisted.logger.test.test_util -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Logging utilities.
"""
from typing import List
from ._interfaces import LogTrace
from ._logger import Logger
def formatTrace(trace: LogTrace) -> str:
"""
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.
@return: A multi-line string with indentation and arrows indicating the
flow of the message through various observers.
"""
def formatWithName(obj: object) -> str:
if hasattr(obj, "name"):
return f"{obj} ({obj.name})"
else:
return f"{obj}"
result = []
lineage: List[Logger] = []
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(f"{formatWithName(parent)}\n")
lineage.append(parent)
result.append(" " * len(lineage))
result.append(f"-> {formatWithName(child)}\n")
return "".join(result)
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| test | Folder | 0755 |
|
|
| __init__.py | File | 3.29 KB | 0644 |
|
| _buffer.py | File | 1.49 KB | 0644 |
|
| _capture.py | File | 624 B | 0644 |
|
| _file.py | File | 2.28 KB | 0644 |
|
| _filter.py | File | 6.71 KB | 0644 |
|
| _flatten.py | File | 4.88 KB | 0644 |
|
| _format.py | File | 13.16 KB | 0644 |
|
| _global.py | File | 8.43 KB | 0644 |
|
| _interfaces.py | File | 2.29 KB | 0644 |
|
| _io.py | File | 4.44 KB | 0644 |
|
| _json.py | File | 8.21 KB | 0644 |
|
| _legacy.py | File | 5.12 KB | 0644 |
|
| _levels.py | File | 2.89 KB | 0644 |
|
| _logger.py | File | 9.75 KB | 0644 |
|
| _observer.py | File | 3.17 KB | 0644 |
|
| _stdlib.py | File | 4.42 KB | 0644 |
|
| _util.py | File | 1.34 KB | 0644 |
|