Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/dill/__pycache__/logger.cpython-39.pyc
Ðазад
a h�h�+ � @ s d Z g d�ZddlZddlZddlZddlZddlZddlZddlm Z ddl mZmZ ddl Z e�ddddd ��ZG d d� dej�ZG dd � d ej�Ze�d�Zde_ee�Ze�� Ze�e� ddd�eeeeejf edd�dd�ZG dd� 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: <module 'dill.tests' from '.../dill/tests/__init__.py'> ├┬ F2: <function _import_module at 0x7f0d2dce1b80> │└ # F2 [32 B] ├┬ D2: <dict object at 0x7f0d2e98a540> │├┬ T4: <class '_frozen_importlib.ModuleSpec'> ││└ # T4 [35 B] │├┬ D2: <dict object at 0x7f0d2ef0e8c0> ││├┬ T4: <class '_frozen_importlib_external.SourceFileLoader'> │││└ # T4 [50 B] ││├┬ D2: <dict object at 0x7f0d2e988a40> │││└ # D2 [84 B] ││└ # D2 [413 B] │└ # D2 [763 B] └ # M1 [813 B] )�adapter�logger�trace� N)�partial)�TextIO�Union�|�+�`)� │u ├� ┬� └c @ s@ e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � 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 C s || _ d S �N)r )�selfr � r �{/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/dill/logger.py�__init__t s zTraceAdapter.__init__c C s&