
    {Yh                         d Z ddlZddlZddlmZmZ ddlmZmZ dZ	de
ej                 fdZ ej        d          Ze	s#	 ddlZd	Zn# e$ r d
ZY nw xY w eedd          Zdej        ded         fdZdS )a  Logging utilities for Dynamo and Inductor.

This module provides specialized logging functionality including:
- Step-based logging that prepends step numbers to log messages
- Progress bar management for compilation phases
- Centralized logger management for Dynamo and Inductor components

The logging system helps track the progress of compilation phases and provides structured
logging output for debugging and monitoring.
    N)AnyCallable)	_FaketqdmtqdmTreturnc                  x    t          j        d          t          j        d          t          j        d          gS )Nz%torch.fx.experimental.symbolic_shapesztorch._dynamoztorch._inductor)logging	getLogger     g/var/www/tools.fuzzalab.pt/emblema-extractor/venv/lib/python3.11/site-packages/torch/_dynamo/logging.pyget_loggersr      s8    ABB/**+,, r            ztorch.compile())totaldescdelaylogger).Nc                 $    t           sTt                              d           t          t          t                    s t                               j                    t          t                    dt          dt          dt          dd f fd}|S )Nr   levelmsgkwargsr   c                 <    d|vrd|d<    j         | d|fi | d S )N
stacklevelr   zStep %s: %s)log)r   r   r   r   steps      r   r   zget_step_logger.<locals>.logC   s>    v%%#$F< 
5-s==f=====r   )disable_progresspbarupdate
isinstancer   set_postfix_strnamenext_step_counterintstrr   )r   r   r   s   ` @r   get_step_loggerr(   ;   s     3A$	** 	3  FK!1222D>3 >S >C >D > > > > > > >
 Jr   )__doc__	itertoolsr	   typingr   r   	torch.hubr   r   r   listLoggerr   countr%   triton	num_stepsImportErrorr   r(   r   r   r   <module>r3      s!  	 	                      % % % % % % % %  T'.)    &  	""  B		   			4i&7qAAADGN x	/B      s   A AA