
    i                         S r SSKrSSKrSSKrSSKrSSKJr  0 r\R                  " 5       SS\R                  S4S j5       rg)zh
This code is refer from:
https://github.com/WenmuZhou/PytorchOCR/blob/master/torchocr/utils/logging.py
    Nppocr0c                    [         R                  " U 5      nU [        ;   a  U$ [         H  nU R                  U5      (       d  M  Us  $    [         R                  " SSS9n[         R
                  " [        R                  S9nUR                  U5        UR                  U5        Ub  [        R                  " 5       S:X  ap  [        R                  R                  U5      S   n[        R                  " USS9  [         R                   " US5      n	U	R                  U5        UR                  U	5        [#        U[$        5      (       a+  UR                  S	5       V
s/ s H  n
['        U
5      PM     nn
O[#        U[&        5      (       a  U/n[        R                  " 5       U;   a  UR)                  U5        OUR)                  [         R*                  5        S[        U '   S
Ul        U$ s  sn
f )a0  Initialize and get a logger by name.
If the logger has not been initialized, this method will initialize the
logger by adding one or two handlers, otherwise the initialized logger will
be directly returned. During initialization, a StreamHandler will always be
added. If `log_file` is specified a FileHandler will also be added.
Args:
    name (str): Logger name.
    log_file (str | None): The log filename. If specified, a FileHandler
        will be added to the logger.
    log_level (int): The logger level. Note that only the process of
        rank 0 is affected, and other processes will set the level to
        "Error" thus be silent most of the time.
    log_ranks (str): The ids of gpu to log which are separated by "," when more than 1, "0" by default.
Returns:
    logging.Logger: The expected logger.
z1[%(asctime)s] %(name)s %(levelname)s: %(message)sz%Y/%m/%d %H:%M:%S)datefmt)streamr   T)exist_oka,F)logging	getLoggerlogger_initialized
startswith	FormatterStreamHandlersysstdoutsetFormatter
addHandlerdistget_rankospathsplitmakedirsFileHandler
isinstancestrintsetLevelERROR	propagate)namelog_file	log_level	log_ranksloggerlogger_name	formatterstream_handlerlog_file_folderfile_handleris              ]/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddleocr/ppocr/utils/logging.py
get_loggerr.      s}   $ t$F!!)??;''M * !!;EXI **#**=N	*
n%1 4''--1!4
Od3**8S9!!),,')S!!%.__S%9:%9SV%9	:		Is	#	#K	}})#	"&#tFM ;s   G#)__doc__r   r   r   	functoolspaddle.distributeddistributedr   r   	lru_cacheDEBUGr.        r-   <module>r7      sK   
 
 
   !  dgmms 1 1r6   