
     h                        d dl Z d dlZd dlmZ d dlmZmZmZ d dlm	Z	 d dl
mZ g dZ G d de j                  Z ed	
           G d d                      Zej        Zddeeef         fdZdeee         ef         fdZdS )    N)	dataclass)DictOptionalUnion)ConfigurationError)get_and_apply)StdLogOutput	LogConfigparse_logging_configc                   J    e Zd Z ej                    Z ej                    ZdS )r	   N)__name__
__module____qualname__enumautoSTDERRSTDOUT     R/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/pyhanko/config/logging.pyr	   r	      s(        TY[[FTY[[FFFr   r	   T)frozenc                   t    e Zd ZU eeef         ed<   	 eeef         ed<   	 edeeef         fd            Z	dS )r
   leveloutputreturnc                     t          | t                    st          d          |                                 }|dk    rt          j        S |dk    rt          j        S | S )Nz)Log output must be specified as a string.stderrstdout)
isinstancestrr   lowerr	   r   r   )specspec_ls     r   parse_output_speczLogConfig.parse_output_spec   se    $$$ 	$;   X&&x&&Kr   N)
r   r   r   r   intr    __annotations__r	   staticmethodr$   r   r   r   r
   r
      s}         c? ,#$$$$ 5s):#;    \  r   r
   r   c                     	 | |         }n'# t           $ r ||cY S t          d| d          w xY wt          |t          t          f          st          dt          |                     |S )NzLogging config for 'z' does not define a log level.z#Log levels must be int or str, not )KeyErrorr   r   r%   r    type)settings_dictkeydefault
level_specs       r   _retrieve_log_levelr/   /   s    
"3'

 
 
 
NNN F3FFF
 
 	

 j3*-- 
 D$z2B2BDD
 
 	
 s    //c                 t   t          | t                    st          d          t          | dt                    }t          | dt          j        t          j	                  }d t          ||          i}| 
                    di           }t          |t                    st          d          |                                D ]t\  }}t          |t                    st          d          t          |d          }t          |d	t          j        t          j	                  }t          ||
          ||<   u|S )Nz%logging config should be a dictionaryz
root-level)r-   zroot-outputz	by-modulez"logging.by-module should be a dictz+Keys in logging.by-module should be stringsr   r   )r   r   )r   dictr   r/   DEFAULT_ROOT_LOGGER_LEVELr   r
   r$   r	   r   getitemsr    )	log_config_specroot_logger_levelroot_logger_output
log_configlogging_by_modulemodulemodule_logging_settingsr.   output_specs	            r   r   r   ?   sc   ot,, J !HIII+/H   '##	   	i)+=>>2J (++K<<'.. G !EFFF+<+B+B+D+D M M''&#&& 	$=   ))@'JJ
##' '	
 
 
 'ZLLL
6r   )N)r   loggingdataclassesr   typingr   r   r   pyhanko.config.errorsr   pyhanko.pdf_utils.miscr   __all__Enumr	   r
   INFOr2   r%   r    r/   r   r   r   r   <module>rE      sI     ! ! ! ! ! ! ( ( ( ( ( ( ( ( ( ( 4 4 4 4 4 4 0 0 0 0 0 0
?
?
?    49   
 $       4 $L  U38_     %T(3-2J-K % % % % % %r   