+
    ~jr                    $  a  0 t $ ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
HtH
t
HtHt ^ RIHt ^ RIHt ^RIHt . ROtR R	 ltRtR
]R&   R R ltR R lt ! R R]P4                  4      t ! R R]P4                  4      tR R ltR# )    )annotationsN)OrderedDict)datedatetimetimetimezone)istraceback)Any)Pluginc                   V ^8  d   QhRR/# )   returnNone )formats   "k/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/livekit/agents/cli/log.py__annotate__r       s     * * *    c                     \          FY  p \        P                  ! V 4      pVP                  \        P                  8X  g   K:  VP                  \        P                  4       K[  	  R # N)NOISY_LOGGERSlogging	getLoggerlevelNOTSETsetLevelWARN)noisy_loggerloggers     r   _silence_noisy_loggersr        s<    %""<0<<7>>)OOGLL) &r   ztuple[str, ...]_RESERVED_ATTRSc               $    V ^8  d   QhRRRRRR/# )r   recordlogging.LogRecordtargetzdict[Any, Any]r   r   r   )r   s   "r   r   r   D   s"         1  >  d  r   c                    V P                   P                  4        FA  w  r#V\        9  g   K  \        VR 4      '       d   VP	                  R4      '       d   K=  W1V&   KC  	  R# )
startswith_N)__dict__itemsr!   hasattrr'   )r#   r%   keyvalues   &&  r   _merge_record_extrar.   D   sE    oo++-
o%wsL/I/Icnn]`NaNa3K .r   c                    V ^8  d   QhRRRR/# )r   	formatterzlogging.Formatterr   z	list[str]r   )r   s   "r   r   r   J   s      - ) r   c                p   \        V P                  \        P                  4      '       d'   \        P
                  ! R\        P                  4      pM\        V P                  \        P                  4      '       d'   \        P
                  ! R\        P                  4      pMh\        V P                  \        P                  4      '       d'   \        P
                  ! R\        P                  4      pM\        RV P                   24      hV P                  '       d   VP                  V P                  4      # . # )z.parse the list of fields required by the stylez\$\{(.+?)\}z	\{(.+?)\}z
%\((.+?)\)zInvalid format: )
isinstance_styler   StringTemplateStylerecompile
IGNORECASEStrFormatStylePercentStyle
ValueError_fmtfindall)r0   formatter_style_patterns   & r   _parse_styler>   J   s    )""G$?$?@@"$**^R]]"K	I$$g&<&<	=	="$**\2=="I	I$$g&:&:	;	;"$**]BMM"J+INN+;<==~~~&..y~~>>	r   c                  d   a  ] tR t^[t ! R R]P
                  4      tR V 3R lltR R ltRt	V ;t
# )JsonFormatterc                  .   a  ] tR t^\tR V 3R lltRtV ;t# )JsonFormatter.JsonEncoderc                    V ^8  d   QhRRRR/# )r   or
   r   r   )r   s   "r   r   &JsonFormatter.JsonEncoder.__annotate__]   s     	  	 S 	 S 	 r   c                	  < \        V\        \        \        34      '       d   VP	                  4       # \        V4      '       d4   R P                  \        P                  ! V4      4      P                  4       # \        V4      \        J g*   \        V\        4      '       g   \        V4      \        J d   \        V4      #  \        SV `9  V4      #   \         d#     \        T4      u #   \         d      R# i ; ii ; i) N)r2   r   r   r   	isoformatr	   join	traceback	format_tbstriptype	Exceptionstrsuperdefault	TypeError)selfrD   	__class__s   &&r   rQ   !JsonFormatter.JsonEncoder.default]   s    !dHd344{{}$Qwwy22156<<>>aI%Ay)A)AT!WPT_1v wq))   q6M     s0   ?C C;
C'$C;'C72C;6C77C;r   )__name__
__module____qualname____firstlineno__rQ   __static_attributes____classcell__rT   s   @r   JsonEncoderrB   \   s    	  	 r   r]   c               $    V ^8  d   QhRRRRRR/# r   argsr
   kwargsr   r   r   )r   s   "r   r   JsonFormatter.__annotate__n   s!     3 3c 3S 3T 3r   c                	H   < \         SV `  ! V/ VB  \        V 4      V n        R # r   )rP   __init__r>   _required_fieldsrS   r`   ra   rT   s   &*,r   rd   JsonFormatter.__init__n   s"    $)&) ,T 2r   c                    V ^8  d   QhRRRR/# r   r#   r$   r   rO   r   )r   s   "r   r   rb   r   s      Y  Y.  Y3  Yr   c                "   / pVP                   VR&   VP                  VR&   \        VP                  \        4      '       d   VP                  pRVn        MVP                  4       Vn        RV P                  9   d!   V P                  WP                  4      Vn
        VP                  '       d6   VP                  R4      '       g   V P                  VP                  4      VR&   VP                  R4      '       g"   VP                  '       d   VP                  VR&   VP                  '       d6   VP                  R4      '       g   V P!                  VP                  4      VR&   \#        4       pV P                   F   pVP$                  P                  V4      W4&   K"  	  VP'                  V4       \)        W4       \*        P,                  ! VP.                  \0        P2                  R7      VR&   \4        P6                  ! V\8        P:                  R	R
7      # )z+Formats a log record and serializes to jsonr   namerG   asctimeexc_info
stack_info)tz	timestampFclsensure_ascii)	levelnamerk   r2   msgdictmessage
getMessagere   
formatTimedatefmtrl   rm   getformatExceptionexc_textrn   formatStackr   r)   updater.   r   fromtimestampcreatedr   utcjsondumpsr@   r]   )rS   r#   message_dict
log_recordfields   &&   r   r   JsonFormatter.formatr   s   ') & 0 0W%{{Vfjj$''!::LFN#..0FN---!__V\\BFN???<#3#3J#?#?'+';';FOO'LL$
++'-L$\%5%5l%C%C)-)9)9&:K:K)LL&%0]
**E & 3 3E :J + 	,'F/"*"8"8HLL"Y
;zz*-*C*CRWXXr   )re   )rV   rW   rX   rY   r   JSONEncoderr]   rd   r   rZ   r[   r\   s   @r   r@   r@   [   s+     d&&  $3 3 Y  Yr   r@   c                  P   a  ] tR t^tR V 3R llt]R R l4       tR R ltRtV ;t	# )ColoredFormatterc               $    V ^8  d   QhRRRRRR/# r_   r   )r   s   "r   r   ColoredFormatter.__annotate__   s!     3 3c 3S 3T 3r   c                	|  < \         SV `  ! V/ VB  R V P                  ^ 4      RV P                  ^4      RV P                  ^ 4      RV P                  ^!4      RV P                  ^"4      RV P                  ^#4      RV P                  ^$4      RV P                  ^Z4      RV P                  ^^4      /	V n        R	V P                  R,          R
V P                  R,          RV P                  R,          RV P                  R,          RV P                  R,          RV P                  R,          /V n        \        V 4      V n        R# )	esc_resetesc_red	esc_green
esc_yellowesc_blue
esc_purpleesc_cyanesc_grayesc_bold_redDEBUGINFOWARNINGERRORCRITICALDEVN)rP   rd   _esc
_esc_codes_level_colorsr>   re   rf   s   &*,r   rd   ColoredFormatter.__init__   s   $)&)1tyy}2$))B-		"$))B-		"		"DIIa,

 T__Z0DOOK0t|4T__Y/74??<0
 !-T 2r   c                    V ^8  d   QhRRRR/# )r   codesintr   rO   r   )r   s   "r   r   r      s     E E# E# Er   c                	N    R RP                  R V 4       4      ,           R,           # )z[;c              3  8   "   T F  p\        V4      x  K  	  R # 5ir   )rO   ).0codes   & r   	<genexpr>(ColoredFormatter._esc.<locals>.<genexpr>   s     !>#d))s   m)rI   )rr   r   s   &*r   r   ColoredFormatter._esc   s!    !>!>>>DDr   c                    V ^8  d   QhRRRR/# ri   r   )r   s   "r   r   r      s     2 2$5 2# 2r   c                   / p\        W4       / pV P                   F   pVP                  P                  V4      W4&   K"  	  V P                  P                  VP
                  R4      VR&   RVR&   VP                  V P                  4       V P                   F  pWB9   g   K  W$ K  	  V'       d+   \        P                  ! V\        P                  RR7      VR&   V P                  P                  V,          pWPP                  R,          ,           # )z Formats a log record with colorsrG   esc_levelcolorextraFrq   r   )r.   re   r)   r{   r   rt   r   r   r   r   r@   r]   r3   r;   )rS   r#   r   r`   r   ru   s   &&    r   formatMessageColoredFormatter.formatMessage   s     !#F***E //--e4DK + "&!3!3!7!78H8H"!MWDOO$**E~L +  JJu-2K2KZ_`DMkk%__[111r   )r   r   re   )
rV   rW   rX   rY   rd   classmethodr   r   rZ   r[   r\   s   @r   r   r      s-    3 32 E E2 2r   r   c               (    V ^8  d   QhRRRRRRRR/# )r   	log_levelrO   devmodeboolconsoler   r   r   )r   s   "r   r   r      s.     'E 'ES 'E4 'E$ 'E4 'Er   c                v  a  \         P                  ! 4       p\         P                  ! \        P                  4      pV'       d2   V'       d   \        R 4      pM\        R4      pVP                  V4       M\        4       pVP                  V4       TP                  V4       VP                  S 4       \        4        ^RIHp VP                  \         P                  8X  d   VP                  S 4       R V 3R llp\        P                    F  p	V! V	4       K  	  \        P"                  P%                  RV4       R# )zj%(asctime)s - %(esc_levelcolor)s%(levelname)-4s%(esc_reset)s %(name)s - %(message)s %(esc_gray)s%(extra)szi%(asctime)s - %(esc_levelcolor)s%(levelname)-4s%(esc_reset)s %(name)s - %(message)s %(esc_gray)s%(extra)s)r   c                    V ^8  d   QhRRRR/# )r   pluginr   r   r   r   )r   s   "r   r   #setup_logging.<locals>.__annotate__   s     . . .D .r   c                   < V P                   eI   V P                   P                  \        P                  8X  d   V P                   P	                  S4       R # R # R # r   )r   r   r   r   r   )r   r   s   &r   _configure_plugin_logger/setup_logging.<locals>._configure_plugin_logger   s=    ==$)<)<)NMM""9- *O$r   plugin_registeredN)r   r   StreamHandlersysstdoutr   setFormatterr@   
addHandlerr   r    logr   r   r   r   registered_pluginsemitteron)
r   r   r   roothandlercolored_formatterjson_formatterr   r   r   s
   f&&       r   setup_loggingr      s    D##CJJ/G 0}! !1{! 	./ '^,OOGMM)||w~~%	". . ++ ( , NN)+CDr   )httpxhttpcoreopenai
watchfiles	anthropiczwebsockets.clientzaiohttp.accesslivekitbotocoreaiobotocorezurllib3.connectionpoolz
mcp.client)r`   rl   r   rm   r}   filenamefuncNamert   levelnolinenomodulemsecsrw   ru   rk   pathnameprocessprocessNamerelativeCreatedrn   thread
threadNametaskName)__conditional_annotations__
__future__r   r   r   r5   r   rJ   collectionsr   r   r   r   r   inspectr	   typingr
   r   r   r   r    r!   __annotations__r.   r>   	Formatterr@   r   r   )r   s   @r   <module>r      s    " "   	 
  # 3 3    *$ 6 "7YG%% 7Yt42w(( 42n'Er   