+
    Q(iX                     ~  a  R t0 t R t^ RIt^ RIt^ RIHtHtHt ^ RIH	t	 ^ RI
Ht ^ RIHt ^ RItR R ltRR	 R
 llt]P"                  RR R ll4       tR]P&                  R]P(                  R]P*                  R]P,                  R]P.                  RR/t] ^ k  ! R R]P2                  4      tRR R lltR R ltR# )zLogging utilities for FastMCP.N)AnyLiteralcast)Console)RichHandler)overridec                D    V ^8  d   QhR\         R\        P                  /# )   namereturn)strloggingLogger)formats   "_/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/fastmcp/utilities/logging.py__annotate__r      s     5 5S 5W^^ 5    c                    V P                  R4      '       d   \        P                  ! V R7      # \        P                  ! RV  2R7      # )zGet a logger nested under FastMCP namespace.

Args:
    name: the name of the logger, which will be prefixed with 'FastMCP.'

Returns:
    a configured logger instance
zfastmcp.r
   )
startswithr   	getLoggerr   s   &r   
get_loggerr      s<     z""  d++HTF"344r   INFOc          
          V ^8  d   QhR\         R,          \        ,          R\        P                  R,          R\        R,          R\
        RR/# )r	   levelloggerNenable_rich_tracebacksrich_kwargsr   DEBUGr   WARNINGERRORCRITICAL)r   intr   r   boolr   )r   s   "r   r   r      sY     N) N)BCcIN)NNT!N) !4KN) 	N)
 
N)r   c                   \         P                  P                  '       g   R# Vf   \         P                  P                  pVf   \        P
                  ! R4      p\        P                  ! R4      pRVn        VP                  V 4       VP                  R,           F  pVP                  V4       K  	  \         P                  P                  '       gN   \        P                  ! 4       pVP                  \        P                  ! R4      4       VP                  V4       R# \        RR\!        RR	7      /VB pVP                  V4       VP#                  R
 4       ^ RIp^ RIpR\!        RR	7      RRRRRVR^R\         Wx./p	V	P)                  V4       \        R/ V	B p
V
P                  V4       V
P#                  R 4       VP                  V4       VP                  V
4       R# )z
Configure logging for FastMCP.

Args:
    logger: the logger to configure
    level: the log level to use
    rich_kwargs: the parameters to use for creating RichHandler
Nfastmcpz%(message)sFNNNz%(levelname)s: %(message)sconsoleT)stderrc                     V P                   R J # Nexc_inforecords   &r   <lambda>#configure_logging.<locals>.<lambda>P   s    V__%<r   	show_path
show_levelrich_tracebackstracebacks_max_framestracebacks_suppressc                     V P                   R J# r+   r,   r.   s   &r   r0   r1   h   s    vd/Jr    )r&   settingslog_enabledr   r   r   	Formatter	propagatesetLevelhandlersremoveHandlerenable_rich_loggingStreamHandlersetFormatter
addHandlerr   r   	addFiltermcppydanticupdate)r   r   r   r   	formatterhdlrhandlerrE   rF   traceback_kwargstraceback_handlers   &&&,       r   configure_loggingrM      s    ''' %!(!1!1!H!H~""9-!!-0I F
OOE ""T" # ///'')W../KLM'"  t$
G # <=  	7$'Ue17 K(#7&67""9- JK
g
'(r   c                    V ^8  d   QhR\         R,          R\        P                  R,          R\        R,          R\        /# )r	   r   Nr   r   r   )r   r   r   r$   r   )r   s   "r   r   r   o   sA     0 0:0NNT!0 !4K0 	0r   c              +  "  "   V '       di   \         P                  P                  p\        \        R,          V P                  4       4      p\        RRVRVRV/VB   Rx  \        RRVRVRV/VB  R# Rx  R#   \        RRTRTRT/TB  i ; i5i)a  Context manager to temporarily set log level and restore it afterwards.

Args:
    level: The temporary log level to set (e.g., "DEBUG", "INFO")
    logger: Optional logger to configure (defaults to FastMCP logger)
    enable_rich_tracebacks: Whether to enable rich tracebacks
    **rich_kwargs: Additional parameters for RichHandler

Usage:
    with temporary_log_level("DEBUG"):
        # Code that runs with DEBUG logging
        pass
    # Original log level is restored here
r   r   r   Nr   r8   )r&   r9   	log_levelr   r   upperrM   )r   r   r   r   original_levellog_level_literals   &&&,  r   temporary_log_levelrT   n   s     *  ))33 !CDKKM
 	 	
#	
	
 $:	
 		

	  $ (> 	 	  $ (> 	s   ABA9  B9BBr   r    r!   r"   c                   j   a a ] tR t^t oRV3R lV 3R lllt]V3R lR l4       tV3R ltRtVt	V ;t
# )_ClampedLogFilterc                ^   < V ^8  d   QhRS[ R,          R,          RS[ R,          R,          /# )r	   	min_levelN	max_levelr   )r   )r   __classdict__s   "r   r   _ClampedLogFilter.__annotate__   s;      JK
 JK
	r   c                   < R V n         R V n        \        P                  V4      ;p'       d   V\	        V4      3V n         \        P                  V4      ;p'       d   V\	        V4      3V n        \
        SV `  4        R # r+   )rX   rY   _level_to_nogetr   super__init__)selfrX   rY   min_level_nomax_level_no	__class__s   &&&  r   r`   _ClampedLogFilter.__init__   sj     '++I66<6*C	N;DN'++I66<6*C	N;DNr   c                :   < V ^8  d   QhRS[ P                  RS[/# )r	   r/   r   )r   	LogRecordr$   )r   rZ   s   "r   r   r[      s!      W.. 4 r   c                   V P                   '       d.   V P                   w  r#VP                  V8  d   W!n        W1n        R # V P                  '       d.   V P                  w  rEVP                  V8  d   WAn        WQn        R # R # )T)rY   levelno	levelnamerX   )ra   r/   rc   max_level_namerb   min_level_names   &&    r   filter_ClampedLogFilter.filter   sc    >>>+/>>(L~~,!-#1 >>>+/>>(L~~,!-#1 r   c                z   < V ^8  d   Qh/ S[ S[S[3,          R,          ;R&   S[ S[S[3,          R,          ;R&   # )r	   NrX   rY   )tupler#   r   )r   rZ   s   "r   r   r[      s5     S#X%% S#X%% r   )rY   rX   NN)__name__
__module____qualname____firstlineno__r`   r   rm   __annotate_func____static_attributes____classdictcell____classcell__)rd   rZ   s   @@r   rV   rV      s*      "  -  r   rV   c                    V ^8  d   QhR\         P                  R\        R,          R,          R\        R,          R,          RR/# )r	   r   rX   NrY   r   r   )r   r   r   )r   s   "r   r   r      sP     Y YNNYFG$NY FG$NY 
	Yr   c                V    \        V R7       V P                  \        WR7      R7       R# )a  Clamp the logger to a minimum and maximum level.

If min_level is provided, messages logged at a lower level than `min_level` will have their level increased to `min_level`.
If max_level is provided, messages logged at a higher level than `max_level` will have their level decreased to `max_level`.

Args:
    min_level: The lower bound of the clamp
    max_level: The upper bound of the clamp
)r   )rX   rY   )rm   N)_unclamp_loggerrD   rV   )r   rX   rY   s   &&&r   _clamp_loggerr}      s#     6"
-	WXr   c                <    V ^8  d   QhR\         P                  RR/# )r	   r   r   N)r   r   )r   s   "r   r   r      s     ( (GNN (t (r   c                    V P                   R,           F,  p\        V\        4      '       g   K  V P                  V4       K.  	  R# )z/Remove all clamped log filters from the logger.r'   N)filters
isinstancerV   removeFilter)r   rm   s   & r   r|   r|      s4    ..##f/00' $r   c                    V ^8  d   Qh/ ^ \         9   d0   \        \        R,          R,          \        R,          3,          ;R&   # )r	   Nr]   r   )__conditional_annotations__dictr   r#   )r   s   "r   r   r      s<     $ $B	 	d;<tCS4ZO 	C %r   )r   NNrq   )r   __doc__
contextlibr   typingr   r   r   rich.consoler   rich.loggingr   typing_extensionsr   r&   r   rM   contextmanagerrT   r   r   r    r!   r"   r]   FilterrV   r}   r|   r   )r   s   @r   <module>r      s    $   % %   $ & 5N)b 0 0l W]]
GLLwW]]  $  	& &RY&(r   