+
    Di                        ^ RI Ht ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIt^t	 ! R R]P                  4      t ! R R]4      t ! R	 R
]4      tR# )    )annotationsN)copy)Literalc                     a  ] tR t^tRt]R ]P                  R ]P                  R ]P                  R ]P                  R ]P                  R /tRR V 3R	 llltR
 R ltR R ltR V 3R lltRtV ;t# )ColourizedFormatterz
A custom log formatter class that:

* Outputs the LOG_LEVEL with an appropriate color.
* If a log call includes an `extra={"color_message": ...}` it will be used
  for formatting the output, instead of the plain text message.
c                	D    \         P                  ! \        V 4      R R7      # )bluefgclickstylestr
level_names   &m/Users/tonyclaw/.openclaw/workspace/services/omi-webhook/venv/lib/python3.14/site-packages/uvicorn/logging.py<lambda>ColourizedFormatter.<lambda>   s    EKKJF,S    c                	D    \         P                  ! \        V 4      R R7      # )cyanr
   r   r   s   &r   r   r      s    %++c*o&*Qr   c                	D    \         P                  ! \        V 4      R R7      # greenr
   r   r   s   &r   r   r      s    S_)Qr   c                	D    \         P                  ! \        V 4      R R7      # yellowr
   r   r   s   &r   r   r      s    EKKJH,Ur   c                	D    \         P                  ! \        V 4      R R7      # redr
   r   r   s   &r   r   r      s    %++c*o%*Pr   c                	D    \         P                  ! \        V 4      R R7      # 
bright_redr
   r   r   s   &r   r   r      s    U[[Z\-Zr   c               (    V ^8  d   QhRRRRRRRR/# )   fmtz
str | Nonedatefmtr   zLiteral['%', '{', '$']
use_colorszbool | None )formats   "r   __annotate__ ColourizedFormatter.__annotate__    s8     @ @@ @ &	@
  @r   c                	   < VR9   d   W@n         M#\        P                  P                  4       V n         \        SV `  WVR7       R# )T)r&   r'   r   N)TF)r(   sysstdoutisattysuper__init__)selfr&   r'   r   r(   	__class__s   &&&&&r   r2   ColourizedFormatter.__init__    s8     &(O!jj//1DOS?r   c               $    V ^8  d   QhRRRRRR/# )r%   r   r   level_nointreturnr)   )r*   s   "r   r+   r,   -   s!        3  #  #  r   c                	T    R  R lpV P                   P                  W#4      pV! V4      # )c                    V ^8  d   QhRRRR/# )r%   r   r   r9   r)   )r*   s   "r   r+   :ColourizedFormatter.color_level_name.<locals>.__annotate__.   s     	# 	# 	# 	#r   c                    \        V 4      # N)r   r   s   &r   default5ColourizedFormatter.color_level_name.<locals>.default.   s    z?"r   )level_name_colorsget)r3   r   r7   r?   funcs   &&&  r   color_level_name$ColourizedFormatter.color_level_name-   s*    	# %%))(<Jr   c                   V ^8  d   QhRR/# r%   r9   boolr)   )r*   s   "r   r+   r,   4   s      4 r   c                	    R # )Tr)   r3   s   &r   should_use_colors%ColourizedFormatter.should_use_colors4   s    r   c                    V ^8  d   QhRRRR/# r%   recordzlogging.LogRecordr9   r   r)   )r*   s   "r   r+   r,   7   s     
1 
1$5 
1# 
1r   c                	  < \        V4      pVP                  pR ^\        VP                  4      ,
          ,          pV P                  '       db   V P	                  W2P
                  4      pRVP                  9   d6   VP                  R,          Vn        VP                  4       VP                  R&   VR,           V,           VP                  R&   \        SV `)  V4      # ) color_messagemessage:levelprefix)r   	levelnamelenr(   rD   levelno__dict__msg
getMessager1   formatMessage)r3   rO   
recordcopyrV   	seperatorr4   s   &&   r   r\   !ColourizedFormatter.formatMessage7   s    &\
((	1s:#7#7889	???--i9K9KLI*"5"55!+!4!4_!E
1;1F1F1H
##I.-6_y-H
M*w$Z00r   )r(   )NN%N)__name__
__module____qualname____firstlineno____doc__TRACE_LOG_LEVELloggingDEBUGINFOWARNINGERRORCRITICALrA   r2   rD   rK   r\   __static_attributes____classcell__r4   s   @r   r   r      sl     	SQQUPZ@ @ 
1 
1r   r   c                  "    ] tR t^DtR R ltRtR# )DefaultFormatterc                   V ^8  d   QhRR/# rG   r)   )r*   s   "r   r+   DefaultFormatter.__annotate__E   s     # #4 #r   c                	>    \         P                  P                  4       # r>   )r.   stderrr0   rJ   s   &r   rK   "DefaultFormatter.should_use_colorsE   s    zz  ""r   r)   N)ra   rb   rc   rd   rK   rm   r)   r   r   rq   rq   D   s    # #r   rq   c            
      \   a  ] tR t^It^R ^R ^R ^R ^R /tR R ltR V 3R	 lltR
tV ;t# )AccessFormatterc                	D    \         P                  ! \        V 4      R R7      # )bright_whiter
   r   codes   &r   r   AccessFormatter.<lambda>K   s    CI.Ar   c                	D    \         P                  ! \        V 4      R R7      # r   r   r{   s   &r   r   r}   L   s    CI':r   c                	D    \         P                  ! \        V 4      R R7      # r   r   r{   s   &r   r   r}   M   s    CI(;r   c                	D    \         P                  ! \        V 4      R R7      # r   r   r{   s   &r   r   r}   N   s    CI%8r   c                	D    \         P                  ! \        V 4      R R7      # r"   r   r{   s   &r   r   r}   O   s    CI,?r   c                    V ^8  d   QhRRRR/# )r%   status_coder8   r9   r   r)   )r*   s   "r   r+   AccessFormatter.__annotate__R   s     ! !3 !3 !r   c                	
  a  \         P                  ! V4      P                  pV RV 2oV P                  '       d5   R V3R llpV P
                  P                  V^d,          V4      pV! S4      # S#   \         d    R p L^i ; i) rQ   c                    V ^8  d   QhRRRR/# )r%   r|   r8   r9   r   r)   )r*   s   "r   r+   5AccessFormatter.get_status_code.<locals>.__annotate__Z   s     ) )c )c )r   c                   < S# r>   r)   )r|   status_and_phrases   &r   r?   0AccessFormatter.get_status_code.<locals>.defaultZ   s	    ((r   )http
HTTPStatusphrase
ValueErrorr(   status_code_coloursrB   )r3   r   status_phraser?   rC   r   s   &&   @r   get_status_codeAccessFormatter.get_status_codeR   s    	 OOK8??M  +m1]O<???) ) ++//s0BGLD)**    	M	s    A2 2BBc                    V ^8  d   QhRRRR/# rN   r)   )r*   s   "r   r+   r   a   s     1 1$5 1# 1r   c                	:  < \        V4      pVP                  w  pppppV P                  \        V4      4      pV R V RV 2pV P                  '       d   \
        P                  ! VRR7      pVP                  P                  RVRVRV/4       \        S	V `)  V4      # )rQ   z HTTP/T)boldclient_addrrequest_liner   )r   argsr   r8   r(   r   r   rY   updater1   r\   )
r3   rO   r]   r   method	full_pathhttp_versionr   r   r4   s
   &&       r   r\   AccessFormatter.formatMessagea   s    &\
 OO	
**3{+;< 9+VL>B??? ;;|$?L""{{	
 w$Z00r   r)   )	ra   rb   rc   rd   r   r   r\   rm   rn   ro   s   @r   rx   rx   I   s8    	A	:	;	8	?!1 1r   rx   )
__future__r   r   rg   r.   r   typingr   r   rf   	Formatterr   rq   rx   r)   r   r   <module>r      sL    "   
   31'++ 31l#* #
,1) ,1r   