
    .Pha
                         d Z ddlZddlZej        Z G d dej                  Z e            Z ed          Ze                    e           d	dZ	d	dZ
dS )
a  Logging utilities for Dulwich.

Any module that uses logging needs to do compile-time initialization to set up
the logging environment. Since Dulwich is also used as a library, clients may
not want to see any logging output. In that case, we need to use a special
handler to suppress spurious warnings like "No handlers could be found for
logger dulwich.foo".

For details on the _NullHandler approach, see:
http://docs.python.org/library/logging.html#configuring-logging-for-a-library

For many modules, the only function from the logging module they need is
getLogger; this module exports that function for convenience. If a calling
module needs something else, it can import the standard logging module
directly.
    Nc                       e Zd ZdZddZdS )_NullHandlerz;No-op logging handler to avoid unexpected logging warnings.returnNc                     d S )N )selfrecords     Q/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/dulwich/log_utils.pyemitz_NullHandler.emit0   s        r   N)__name__
__module____qualname____doc__r   r   r   r
   r   r   -   s.        EE     r   r   dulwichr   c                  x    t                       t          j        t          j        t          j        d           dS )z#Set up the default Dulwich loggers.z&%(asctime)s %(levelname)s: %(message)s)levelstreamformatN)remove_null_handlerloggingbasicConfigINFOsysstderrr   r   r
   default_logging_configr   9   s?    lz7     r   c                  D    t                               t                     dS )zRemove the null handler from the Dulwich loggers.

    If a caller wants to set up logging using something other than
    default_logging_config, calling this function first is a minor optimization
    to avoid the overhead of using the _NullHandler.
    N)_DULWICH_LOGGERremoveHandler_NULL_HANDLERr   r   r
   r   r   C   s     !!-00000r   r   )r   r   r   	getLoggerHandlerr   r!   r   
addHandlerr   r   r   r   r
   <module>r%      s   , "  



	    7?    )I&&   = ) ) )   1 1 1 1 1 1r   