X7ROOT File Manager
Current Path:
/opt/hc_python/lib/python3.12/site-packages/sentry_sdk
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sentry_sdk
/
📁
..
📄
__init__.py
(1.19 KB)
📁
__pycache__
📄
_compat.py
(3.04 KB)
📄
_init_implementation.py
(2.5 KB)
📄
_log_batcher.py
(4.97 KB)
📄
_lru_cache.py
(1.2 KB)
📄
_queue.py
(10.99 KB)
📄
_types.py
(10.22 KB)
📄
_werkzeug.py
(3.65 KB)
📁
ai
📄
api.py
(11.59 KB)
📄
attachments.py
(3.04 KB)
📄
client.py
(37.14 KB)
📄
consts.py
(39.68 KB)
📁
crons
📄
debug.py
(1019 B)
📄
envelope.py
(10.11 KB)
📄
feature_flags.py
(2.18 KB)
📄
hub.py
(25.07 KB)
📁
integrations
📄
logger.py
(1.62 KB)
📄
metrics.py
(29.21 KB)
📄
monitor.py
(3.62 KB)
📁
profiler
📄
py.typed
(0 B)
📄
scope.py
(61.85 KB)
📄
scrubber.py
(5.92 KB)
📄
serializer.py
(12.78 KB)
📄
session.py
(5.44 KB)
📄
sessions.py
(8.97 KB)
📄
spotlight.py
(8.47 KB)
📄
tracing.py
(46.99 KB)
📄
tracing_utils.py
(28.14 KB)
📄
transport.py
(31.84 KB)
📄
types.py
(1.19 KB)
📄
utils.py
(57.98 KB)
📄
worker.py
(4.36 KB)
Editing: logger.py
# NOTE: this is the logger sentry exposes to users, not some generic logger. import functools import time from typing import Any from sentry_sdk import get_client, get_current_scope from sentry_sdk.utils import safe_repr def _capture_log(severity_text, severity_number, template, **kwargs): # type: (str, int, str, **Any) -> None client = get_client() scope = get_current_scope() attrs = { "sentry.message.template": template, } # type: dict[str, str | bool | float | int] if "attributes" in kwargs: attrs.update(kwargs.pop("attributes")) for k, v in kwargs.items(): attrs[f"sentry.message.parameter.{k}"] = v attrs = { k: ( v if ( isinstance(v, str) or isinstance(v, int) or isinstance(v, bool) or isinstance(v, float) ) else safe_repr(v) ) for (k, v) in attrs.items() } # noinspection PyProtectedMember client._capture_experimental_log( scope, { "severity_text": severity_text, "severity_number": severity_number, "attributes": attrs, "body": template.format(**kwargs), "time_unix_nano": time.time_ns(), "trace_id": None, }, ) trace = functools.partial(_capture_log, "trace", 1) debug = functools.partial(_capture_log, "debug", 5) info = functools.partial(_capture_log, "info", 9) warning = functools.partial(_capture_log, "warn", 13) error = functools.partial(_capture_log, "error", 17) fatal = functools.partial(_capture_log, "fatal", 21)
Upload File
Create Folder