
    [Th                         S SK r S SKrS SKrS SKrS SKJr  S SKJr  S
S\\   4S jjr	S
S\\   4S jjr
SS\S\\   4S	 jjrg)    N)Optional)get_log_levelnamec                 8    [        U =(       d	    [        SS95      $ )aO  
Util function to set up a simple logger that writes
into stderr. The loglevel is fetched from the LOGLEVEL
env. variable or WARNING as default. The function will use the
module name of the caller if no name is provided.

Args:
    name: Name of the logger. If no name provided, the name will
          be derived from the call stack.
   )depth)_setup_logger_derive_module_name)r   s    _/var/www/auris/envauris/lib/python3.13/site-packages/torch/distributed/elastic/utils/logging.py
get_loggerr      s     =!41!=>>    c                     [         R                  " U 5      nUR                  [        R                  R                  S[        5       5      5        U$ )NLOGLEVEL)logging	getLoggersetLevelosenvirongetr   )r   loggers     r   r	   r	   $   s4    t$F
OOBJJNN:}?@Mr   r   returnc                     [         R                  " 5       nU [        U5      :  d   eX   n[         R                  " US   5      nU(       a  UR                  nU$ US   n[
        R                  R                  [
        R                  R                  U5      5      S   nU$ ! [         a(  n[        R                  " SU 3[        5         SnAgSnAff = f)zx
Derives the name of the caller module from the stack frames.

Args:
    depth: The position of the frame in the stack.
r      z<Error deriving logger module name, using <None>. Exception: N)inspectstacklen	getmodule__name__r   pathsplitextbasename	ExceptionwarningswarnRuntimeWarning)r   r   
frame_infomodulemodule_namefilenamees          r   r
   r
   *   s    s5z!!!\
"":a=1 //K  "!}H''**277+;+;H+EFqIK J1#N	
 s   AB  AB   
C*CC)N)r   )r   r   r   r#   typingr   )torch.distributed.elastic.utils.log_levelr   strr   r	   intr
    r   r   <module>r0      sP      	   C?Xc] ?" s 8C= r   