
    9i                        S SK r S SKrS SKrS SKrS SKrSSKJr  / SQrSrSS0SS0SS	0SS
0SS0S.r	\R                  " \5      rS rS rS r\ R                  " S5      S 5       rS rS rS rSS\4S jjrS rS rS rg)    N   )DEBUG)debuginfowarningerrorcriticalsetup_loggingpaddlexcolorpurplegreenyellowredbold_red)r   INFOWARNINGERRORCRITICALc                    [         (       a  [        R                  " 5       nUR                  nUR                  R
                  nSUR                  ;   a$  UR                  S   R                  R                  nO,SUR                  ;   a  UR                  S   R                  nOSnU(       a  U SU 3nOU nSU SU  3n [        R                  " U /UQ70 UD6  gg)r   selfclsNz::u   【u   】)r   inspectcurrentframef_backf_codeco_namef_locals	__class____name___loggerr   )msgargskwargsframecaller_framecaller_func_namecaller_class_namecaller_infos           U/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/paddlex/utils/logging.pyr   r   '   s    u$$&||'..66\*** , 5 5f = G G P Pl+++ , 5 5e < E E $./r2B1CDK-.KK=C5)c+D+F+#     c                 8    [         R                  " U /UQ70 UD6  g)r   N)r!   r   r"   r#   r$   s      r*   r   r   =   s    LL&t&v&r+   c                 8    [         R                  " U /UQ70 UD6  g)r   N)r!   r   r-   s      r*   r   r   B   s    OOC)$)&)r+   c                 "    [        U /UQ70 UD6  g)zk
This method is identical to `logger.warning()`, but will emit the warning with the same message only once
N)r   r-   s      r*   warning_oncer0   G   s    
 C!$!&!r+   c                 8    [         R                  " U /UQ70 UD6  g)r   N)r!   r   r-   s      r*   r   r   O   s    MM#'''r+   c                 8    [         R                  " U /UQ70 UD6  g)r	   N)r!   r	   r-   s      r*   r	   r	   T   s    S*4*6*r+   c                 8    [         R                  " U /UQ70 UD6  g)	exceptionN)r!   r4   r-   s      r*   r4   r4   Y   s    c+D+F+r+   	verbosityc                 n    U c  [         (       a  Sn OSn U b  [        [        U R                  5       5        gg)z{setup logging level

Args:
    verbosity (str, optional): the logging level, `DEBUG`, `INFO`, `WARNING`. Defaults to None.
Nr   r   )r   _configure_loggerr!   upper)r5   s    r*   r
   r
   ^   s5     5II'9??#45 r+   c                 N   US:X  a$  [         R                  [        R                  5        OSUS:X  a$  [         R                  [        R                  5        O)US:X  a#  [         R                  [        R
                  5        SU l        U R                  5       (       d  [        U 5        gg)r7   r   r   r   FN)	r!   setLevelloggingr   r   r   	propagatehasHandlers_add_handler)loggerr5   s     r*   r7   r7   n   st    G'	f	&	i	)FV  r+   c           
         [         R                  " S[        R                  5        VVs0 s H
  u  pXS   _M     snnS9n[        R
                  " [        R                  5      nUR                  U5        U R                  U5        gs  snnf )r>   z%(log_color)s%(message)sr   )
log_colorsN)
colorlogColoredFormatter_LOG_CONFIGitemsr;   StreamHandlersysstderrsetFormatter
addHandler)r?   keyconfformathandlers        r*   r>   r>   {   ss    &&"8C8I8I8KL8K93Cg&8KLF
 ##CJJ/G 
g Ms   Bc                     Sn SnSnS[        [        XU/[         S95      -   n[        SR                  SUS-   -  S	R                  U R	                  U5      5      SUS-   -  S	R                  S
U-  5      S	R                  UR	                  U5      5      S	R                  S
U-  5      S	R                  UR	                  U5      5      SUS-   -  5      5        g)a  
Show the advertising message like the following:

===========================================================
==         PaddleX is powered by PaddlePaddle !          ==
===========================================================
==                                                       ==
==   For more info please go to the following website.   ==
==                                                       ==
==        https://github.com/PaddlePaddle/PaddleX        ==
===========================================================

z$PaddleX is powered by PaddlePaddle !z1For more info please go to the following website.z'https://github.com/PaddlePaddle/PaddleX   )rK   z!
{0}
{1}
{2}
{3}
{4}
{5}
{6}
{7}
=   z=={}== N)lenmaxr   rM   center)	copyrightadwebsiteAD_LENs       r*   	advertiser[      s     7I	<B7GS)1s;<<F4;;6A:OOI,,V456A:OOC&L)OOBIIf-.OOC&L)OOGNN6236A:		
r+   )N)	functoolsr   r;   rG   rB   flagsr   __all__LOGGER_NAMErD   	getLoggerr!   r   r   r   	lru_cacher0   r   r	   r4   strr
   r7   r>   r[    r+   r*   <module>rd      s        
  
Lx g"u*% 

K
(,,'
*
 T" "(
+
,
6S 6 
	r+   