§
    %`ƒi]  ã                   ó>   — d dl Z d dlmZ d dlmZ dedededefd„ZdS )	é    N)Úopen_log)ÚStreamRedirectorÚstdout_filepathÚstderr_filepathÚrotation_bytesÚrotation_backup_countc                 óV  — | rt          j        | ||dd¦  «         |rt          j        |||dd¦  «         t          j                             ¦   «         }t          j                             ¦   «         }t          |dd¬¦  «        t          _        t          |dd¬¦  «        t          _        dS )aË  This function sets up redirection for stdout and stderr if needed, based on the given rotation parameters.

    params:
    stdout_filepath: the filepath stdout will be redirected to; if empty, stdout will not be redirected.
    stderr_filepath: the filepath stderr will be redirected to; if empty, stderr will not be redirected.
    rotation_bytes: number of bytes which triggers file rotation.
    rotation_backup_count: the max size of rotation files.
    FT)Ú
unbufferedÚclosefdN)r   Úredirect_stdoutÚredirect_stderrÚsysÚstdoutÚfilenoÚstderrr   )r   r   r   r   Ústdout_filenoÚstderr_filenos         ún/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/_private/logging_utils.pyÚ redirect_stdout_stderr_if_neededr      s¸   € ð  ð 
ÝÔ(ØØØ!ØØñ	
ô 	
ð 	
ð ð 
ÝÔ(ØØØ!ØØñ	
ô 	
ð 	
õ ”J×%Ò%Ñ'Ô'€MÝ”J×%Ò%Ñ'Ô'€Mõ ˜-°DÀ%ÐHÑHÔH…C„JÝ˜-°DÀ%ÐHÑHÔH…C„J€J€Jó    )r   Úray._private.utilsr   Úray._rayletr   ÚstrÚintr   © r   r   ú<module>r      s~   ðØ 
€
€
€
à 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø (Ð (Ð (Ð (Ð (Ð (ð*IØð*Iàð*Ið ð*Ið ð	*Ið *Ið *Ið *Ið *Ið *Ir   