/opt/cloudlinux/venv/lib/python3.11/site-packages/dill/__pycache__
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/dill/__pycache__/logger.cpython-311.pyc (13363B)
§
öï¹s(¶ìÍã óÒ — d Z g d¢ZddlZddlZddlZddlZddlZddlZddlm Z ddl
mZmZ ddl
Z
e ddddd œ¦ « Z G d
„ dej ¦ « Z G d„ d
ej ¦ « Z ej d¦ « Zde_ ee¦ « Z ej ¦ « Ze e¦ « dddœdeeeeej f deddfd„Z G d„ dej ¦ « Z dS )uo
Logging utilities for dill.
The 'logger' object is dill's top-level logger.
The 'adapter' object wraps the logger and implements a 'trace()' method that
generates a detailed tree-style trace for the pickling call at log level INFO.
The 'trace()' function sets and resets dill's logger log level, enabling and
disabling the pickling trace.
The trace shows a tree structure depicting the depth of each object serialized
*with dill save functions*, but not the ones that use save functions from
'pickle._Pickler.dispatch'. If the information is available, it also displays
the size in bytes that the object contributed to the pickle stream (including
its child objects). Sample trace output:
>>> import dill, dill.tests
>>> dill.detect.trace(True)
>>> dill.dump_session(main=dill.tests)
┬ M1:
├┬ F2:
│└ # F2 [32 B]
├┬ D2:
│├┬ T4:
││└ # T4 [35 B]
│├┬ D2:
││├┬ T4:
│││└ # T4 [50 B]
││├┬ D2:
│││└ # D2 [84 B]
││└ # D2 [413 B]
│└ # D2 [763 B]
â”” # M1 [813 B]
)ÚadapterÚloggerÚtraceé N)Úpartial)ÚTextIOÚUnionú|ú+ú`)õ │u ├õ ┬õ â””c ó6 — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z dS ) ÚTraceAdaptera
Tracks object tree depth and calculates pickled object size.
A single instance of this wraps the module's logger, as the logging API
doesn't allow setting it directly with a custom Logger subclass. The added
'trace()' method receives a pickle instance as the first argument and
creates extra values to be added in the LogRecord from it, then calls
'info()'.
Usage of logger with 'trace()' method:
>>> from dill.logger import adapter as logger #NOTE: not dill.logger.logger
>>> ...
>>> def save_atype(pickler, obj):
>>> logger.trace(pickler, "Message with %s and %r etc. placeholders", 'text', obj)
>>> ...
c ó — || _ d S ©N)r )Úselfr s ú]/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/dill/logger.pyÚ__init__zTraceAdapter.__init__t s
€ ؈Œˆˆó c ó† — t d|¬¦ « }| |¦ « | j |¦ « d S )Nz%(prefix)s%(message)s%(suffix)s©Úhandler)ÚTraceFormatterÚsetFormatterr Ú
addHandler)r r Ú formatters r r zTraceAdapter.addHandlerv sE € Ý"Ð#DÈgÐVÑVÔVˆ Ø×Ò˜YÑ'Ô'Ð'ØŒ×Ò˜wÑ'Ô'Ð'Ð'Ð'r c ó: — | j |¦ « d S r )r Ú
removeHandler)r r s r r zTraceAdapter.removeHandlerz s € ØŒ×!Ò! 'Ñ*Ô*Ð*Ð*Ð*r c ó
— ||fS r © )r ÚmsgÚkwargss r ÚprocesszTraceAdapter.process| s € à�Fˆ{Ðr c ó¸ — t j |d¬¦ « sd S | t j ¦ « rd|_ g |_ d S d |_ d S )NF)Úchildé )ÚdillÚ_dillÚis_dillÚisEnabledForÚloggingÚINFOÚ_trace_depthÚ_size_stack)r Úpicklers r Útrace_setupzTraceAdapter.trace_setup s` € åŒz×!Ò! '°Ð!Ñ7Ô7ð ØˆFØ×Ò�Wœ\Ñ*Ô*ð (Ø#$ˆGÔ Ø"$ˆGÔÐÐà#'ˆGÔ Ð Ð r c ó¾ — t |d¦ « st j |g|¢R i |¤Ž d S |j €d S | di ¦ « }| d¦ « }d } |j ¦ « }|j j } || ¦ « z
}n"# t $ r |t |¦ « z
}Y nw xY wn# t t f$ r Y nw xY w|�>|s|j
|¦ « n!||j
¦ « z }||d<