+
    TŎi                         ^ RI 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HtHt ^RIHt ^RIHt ^RIHt ]! RR4      t ! R	 R
]4      tR# )    N)
namedtuple)AnyCallableDictIterableListTuple)AbstractAccessLogger)BaseRequest)StreamResponse	KeyMethodz
key methodc                   Z  a a ] tR t^t oRtRRRRRRRR	R
RRRRRRRRRRRRR/tRt]P                  ! R4      t	]P                  ! R4      t
/ t]3V3R lV 3R llltV3R lR lt]V3R lR  l4       t]V3R! lR" l4       t]V3R# lR$ l4       t]V3R% lR& l4       t]V3R' lR( l4       t]V3R) lR* l4       t]V3R+ lR, l4       t]V3R- lR. l4       t]V3R/ lR0 l4       t]V3R1 lR2 l4       t]V3R3 lR4 l4       tV3R5 lR6 lt]V3R7 lR8 l4       tV3R9 lR: ltV3R; ltR<tVt V ;t!# )=AccessLoggeraX  Helper object to log access.

Usage:
    log = logging.getLogger("spam")
    log_format = "%a %{User-Agent}i"
    access_logger = AccessLogger(log, log_format)
    access_logger.log(request, response, time)

Format:
    %%  The percent sign
    %a  Remote IP-address (IP-address of proxy if using reverse proxy)
    %t  Time when the request was started to process
    %P  The process ID of the child that serviced the request
    %r  First line of request
    %s  Response status code
    %b  Size of response in bytes, including HTTP headers
    %T  Time taken to serve the request, in seconds
    %Tf Time taken to serve the request, in seconds with floating fraction
        in .06f format
    %D  Time taken to serve the request, in microseconds
    %{FOO}i  request.headers['FOO']
    %{FOO}o  response.headers['FOO']
    %{FOO}e  os.environ['FOO']

aremote_addresstrequest_start_timeP
process_idrfirst_request_linesresponse_statusbresponse_sizeTrequest_timeTfrequest_time_fracDrequest_time_microirequest_headeroresponse_headerz/%a %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"z.%(\{([A-Za-z0-9\-_]+)\}([ioe])|[atPrsbOD]|Tf?)z(%[^s])c                >   < V ^8  d   QhRS[ P                  RS[RR/# )   logger
log_formatreturnN)loggingLoggerstr)format__classdict__s   "^/Users/ahmad/.openclaw/workspace/scripts/.venv/lib/python3.14/site-packages/aiohttp/web_log.py__annotate__AccessLogger.__annotate__?   s'     ; ;w~~ ;3 ;PT ;    c                   < \         SV `  WR7       \        P                  P	                  V4      pV'       g%   V P                  V4      pV\        P                  V&   Vw  V n        V n        R# )zInitialise the logger.

logger is a logger object to be used for logging.
log_format is a string with apache compatible log format description.

)r)   N)super__init__r   _FORMAT_CACHEgetcompile_format_log_format_methods)selfr(   r)   _compiled_format	__class__s   &&& r0   r6   AccessLogger.__init__?   s_     	7'5599*E#22:>5EL&&z2*:'$-r3   c                L   < V ^8  d   QhRS[ RS[S[ S[S[,          3,          /# )r'   r)   r*   )r-   r	   r   r   )r.   r/   s   "r0   r1   r2   O   s)     '# '# '#sDO7K1L '#r3   c           	     f   \        4       pV P                  P                  V4       F  pV^,          R8X  dE   V P                  V^ ,          ,          p\	        \
        RV^ ,          ,          4      p\        WE4      pMhV P                  V^,          ,          V^,          3p\	        \
        RV^,          ,          4      p\        V\        P                  ! WS^,          4      4      pVP                  V4       K  	  V P                  P                  RV4      pV P                  P                  RV4      pW3# )al  Translate log_format into form usable by modulo formatting

All known atoms will be replaced with %s
Also methods for formatting of those atoms will be added to
_methods in appropriate order

For example we have log_format = "%a %t"
This format will be translated to "%s %s"
Also contents of _methods will be
[self._format_a, self._format_t]
These method will be called and results will be passed
to translated string format.

Each _format_* method receive 'args' which is list of arguments
given to self.log

Exceptions are _format_e, _format_i and _format_o methods which
also receive key name (by functools.partial)

 z
_format_%sz%sz%\1)list	FORMAT_REfindallLOG_FORMAT_MAPgetattrr   r   	functoolspartialappendsub
CLEANUP_RE)r<   r)   methodsatomformat_key1m
key_methodformat_key2s   &&      r0   r9   AccessLogger.compile_formatO   s    . &NN**:6DAw"}"11$q':L,a*@A&{6
#2247;T!WEL,a*@A&{I4E4Eaa4QR
NN:& 7 ^^''z:
__((<
""r3   c          
      8   < V ^8  d   QhRS[ RS[RS[RS[RS[ /# r'   keyrequestresponsetimer*   r-   r   r   float)r.   r/   s   "r0   r1   r2   y   s5     - --&-2@-HM-	-r3   c                F    Vf   R# VP                   P                  V R4      # )Nz(no headers)-headersr8   rV   rW   rX   rY   s   &&&&r0   	_format_iAccessLogger._format_ix   s%     ?! ""3,,r3   c          
      8   < V ^8  d   QhRS[ RS[RS[RS[RS[ /# rU   rZ   )r.   r/   s   "r0   r1   r2      s5     . ..&.2@.HM.	.r3   c                :    VP                   P                  V R 4      # )r]   r^   r`   s   &&&&r0   	_format_oAccessLogger._format_o   s    
 ##C--r3   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# r'   rW   rX   rY   r*   r   r   r[   r-   )r.   r/   s   "r0   r1   r2      s*     - -; -. - -RU -r3   c                6    V f   R# V P                   pVe   V# R# )Nr]   )remote)rW   rX   rY   ips   &&& r0   	_format_aAccessLogger._format_a   s"    ?^^^r,,r3   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# rh   ri   )r.   r/   s   "r0   r1   r2      s*     = =; =. = =RU =r3   c                   \         P                  ! \         P                  ! \        P                  ) R 7      4      p\         P                   P	                  V4      pV\         P                  ! VR 7      ,
          pVP                  R4      # ))secondsz[%d/%b/%Y:%H:%M:%S %z])datetimetimezone	timedeltatime_modnowstrftime)rW   rX   rY   tzrv   
start_times   &&&   r0   	_format_tAccessLogger._format_t   sc    x118;L;L:LMN##B'8--d;;
""#;<<r3   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# rh   ri   )r.   r/   s   "r0   r1   r2      *     $ $; $. $ $RU $r3   c                :    R \         P                  ! 4       ,          # )z<%s>)osgetpidrW   rX   rY   s   &&&r0   	_format_PAccessLogger._format_P   s    		##r3   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# rh   ri   )r.   r/   s   "r0   r1   r2      s*     
 
; 
. 
 
RU 
r3   c                    V f   R# RP                  V P                  V P                  V P                  P                  V P                  P
                  4      # )Nr]   z{} {} HTTP/{}.{})r.   methodpath_qsversionmajorminorr   s   &&&r0   	_format_rAccessLogger._format_r   sE    ?!((NNOOOO!!OO!!	
 	
r3   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# rh   r   r   r[   int)r.   r/   s   "r0   r1   r2      s*      ; .  RU r3   c                    VP                   # N)statusr   s   &&&r0   	_format_sAccessLogger._format_s   s    r3   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# rh   r   )r.   r/   s   "r0   r1   r2      r}   r3   c                    VP                   # r   )body_lengthr   s   &&&r0   	_format_bAccessLogger._format_b   s    ###r3   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# rh   ri   )r.   r/   s   "r0   r1   r2      s*        ;  .    RU  r3   c                *    \        \        V4      4      # r   r-   roundr   s   &&&r0   	_format_TAccessLogger._format_T   s    5;r3   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# rh   ri   )r.   r/   s   "r0   r1   r2      s*      K >  SV r3   c                    R V,          # )z%06f r   s   &&&r0   
_format_TfAccessLogger._format_Tf   s    }r3   c                2   < V ^8  d   QhRS[ RS[RS[RS[/# rh   ri   )r.   r/   s   "r0   r1   r2      s*     * *; *. * *RU *r3   c                8    \        \        VR ,          4      4      # )i@B r   r   s   &&&r0   	_format_DAccessLogger._format_D   s    5())r3   c                x   < V ^8  d   QhRS[ RS[RS[RS[S[S[S[S[ S[S[.S[3,          3,          ,          /# rh   )r   r   r[   r   r	   r-   r   )r.   r/   s   "r0   r1   r2      sS     Y Y"Y.<YDIY	%X{NE&JC&OPPQ	RYr3   c           
     ^    V P                    UUu. uF  w  rEWE! WV4      3NK  	  upp# u uppi r   )r;   )r<   rW   rX   rY   rV   r   s   &&&&  r0   _format_lineAccessLogger._format_line   s0     KO--X-;3fW56-XXXs   )c                    < V ^8  d   QhRS[ /# )r'   r*   )bool)r.   r/   s   "r0   r1   r2      s     6 6 6r3   c                T    V P                   P                  \        P                  4      # )zCheck if logger is enabled.)r(   isEnabledForr+   INFO)r<   s   &r0   enabledAccessLogger.enabled   s     {{''55r3   c                0   < V ^8  d   QhRS[ RS[RS[RR/# )r'   rW   rX   rY   r*   N)r   r   r[   )r.   r/   s   "r0   r1   r2      s*     6 6; 6. 6 6RV 6r3   c                    V P                  WV4      p\        4       p\        4       pV FN  w  rxVP                  V4       VP                  \
        J d   WV&   K0  Vw  rVP                  V	/ 4      pWV
&   WV	&   KP  	  V P                  P                  V P                  \        V4      ,          VR 7       R#   \         d     T P                  P                  R4        R# i ; i))extrazError in loggingN)r   rC   dictrJ   r>   r-   r8   r(   infor:   tuple	Exception	exception)r<   rW   rX   rY   fmt_infovaluesr   rV   valuek1k2dcts   &&&&        r0   logAccessLogger.log   s    	6((DAHVFFE&
e$==C'!&#J FB))B+C#G #"I ' KKT--f=UK 	6KK!!"45	6s   B1B5 5&CCc                b   < V ^8  d   Qh/ S[ S[S[S[S[S[,          3,          3,          ;R&   # )r'   r7   )r   r-   r	   r   r   )r.   r/   s   "r0   r1   r2      s,     X U3Y#7889>Y r3   )r:   r;   )"__name__
__module____qualname____firstlineno____doc__rF   
LOG_FORMATrecompilerD   rL   r7   r6   r9   staticmethodra   re   rm   rz   r   r   r   r   r   r   r   r   propertyr   r   __annotate_func____static_attributes____classdictcell____classcell__)r>   r/   s   @@r0   r   r      s    6 	!\!_^!!N CJ

LMIJ'J<>MAK ; ; '# '#R - - . . - - = = $ $ 
 
   $ $       * *Y Y
 6 6
6 6i  r3   r   )rr   rH   r+   r   r   rY   ru   collectionsr   typingr   r   r   r   r   r	   abcr
   web_requestr   web_responser   r   r   r   r3   r0   <module>r      sD       	 	  " = = % $ ({L1	G6' G6r3   