ó
    Ð]jd  ã                  óô   • % S r SSKJr  SSKrSSKJs  Jr  SSK	J
r
  SSKJrJrJrJr  SSKJrJrJrJr  SSKrSSKJrJrJrJrJr  SS	KJr  \" / S
Q5      r S\!S'   \(       a  SSK"J#r#   " S S\5      r$SS jr%g)z5Integration with the standard library logging module.é    )ÚannotationsN)ÚMapping)ÚNOTSETÚHandlerÚ	LogRecordÚStreamHandler)ÚTYPE_CHECKINGÚAnyÚClassVarÚcasté   )ÚATTRIBUTES_LOGGING_ARGS_KEYÚATTRIBUTES_LOGGING_NAMEÚATTRIBUTES_MESSAGE_KEYÚATTRIBUTES_MESSAGE_TEMPLATE_KEYÚLOGGING_TO_OTEL_LEVEL_NUMBERS)Úis_instrumentation_suppressed)ÚargsÚasctimeÚcreatedÚexc_infoÚexc_textÚfilenameÚfuncNameÚ	levelnameÚlevelnoÚlinenoÚmoduleÚmsecsÚmessageÚmsgÚnameÚpathnameÚprocessÚprocessNameÚrelativeCreatedÚ
stack_infoÚthreadÚ
threadNameÚtaskNamezfrozenset[str]ÚRESERVED_ATTRS)ÚLogfirec                  óv   ^ • \ rS rSr% SrSrS\S'   \\" 5       S4       SU 4S jjjr	SS jr
SS	 jrS
rU =r$ )ÚLogfireLoggingHandleré6   aÇ  A [logging](../../integrations/logging.md) handler that sends logs to **Logfire**.

Args:
    level: The threshold level for this handler. Logging messages which are less severe than *level* will be ignored.
    fallback: A fallback handler to use when [instrumentation is suppressed](../../how-to-guides/suppress.md#suppress-instrumentation).
    logfire_instance: The Logfire instance to use when emitting logs. Defaults to the default global instance.
zstdlib.loggingzClassVar[str]Úcustom_scope_suffixNc                ó–   >• [         TU ]  US9  X l        U=(       d    [        R                  R                  U R                  S9U l        g )N)Úlevel)r0   )ÚsuperÚ__init__ÚfallbackÚlogfireÚDEFAULT_LOGFIRE_INSTANCEÚwith_settingsr0   Úlogfire_instance)Úselfr2   r5   r9   Ú	__class__s       €ÚY/home/mande/repo/quber/.venv/lib/python3.13/site-packages/logfire/integrations/logging.pyr4   ÚLogfireLoggingHandler.__init__A   sG   ø€ ô 	‰Ñ˜uÐÑ%Ø ŒØ!1×!U´W×5UÑ5U× dÑ dØ $× 8Ñ 8ð !eð !
ˆÕó    c                óV  • [        5       (       a  U R                  R                  U5        gU R                  U5      nU R                  R                  UR                  [        UR                  5      [        R                  " UR                  UR                  5      UUR                  S9  g)zDSend the log to Logfire.

Args:
    record: The log record to send.
N)Úmsg_templater2   Ú
attributesr   )r   r5   ÚhandleÚfill_attributesr9   ÚlogÚpopr   r!   r   Úgetr   r   )r:   ÚrecordrA   s      r<   ÚemitÚLogfireLoggingHandler.emitM   s€   € ô )×*Ñ*Ø�M‰M× Ñ  Ô(Øà×)Ñ)¨&Ó1ˆ
à×Ñ×!Ñ!Ø#Ÿ™Ô(GÈÏÉÓTÜ/×3Ò3°F·N±NÀFÇNÁNÓSØ!Ø—_‘_ð	 	"ò 	
r>   c                óR  • UR                   R                  5        VVs0 s H  u  p#U[        ;  d  M  X#_M     nnnUR                  US'   UR                  US'   UR
                  US'   UR                  U[        '   [        U5      u  U[        '   nUR                  U5        U$ s  snnf )z³Fill the attributes to send to Logfire.

This method can be overridden to add more attributes.

Args:
    record: The log record.

Returns:
    The attributes for the log record.
zcode.filepathzcode.linenozcode.function)Ú__dict__Úitemsr+   r#   r   r   r"   r   Ú_format_messager   Úupdate)r:   rG   ÚkÚvrA   r   s         r<   rC   Ú%LogfireLoggingHandler.fill_attributes`   sœ   € ð (.§¡×'<Ñ'<Ô'>ÔZÒ'>™t˜qÀ!Ì>ÑBY“d�a’dÑ'>ˆ
ÑZØ&,§o¡oˆ
�?Ñ#Ø$*§M¡Mˆ
�=Ñ!Ø&,§o¡oˆ
�?Ñ#Ø.4¯k©kˆ
Ô*Ñ+ä3BÀ6Ó3JÑ0ˆ
Ô)Ñ*¨DØ×Ñ˜$ÔàÐùó [s
   žB#²B#)r5   r9   )r2   z	int | strr5   ÚLoggingHandlerr9   zLogfire | NoneÚreturnÚNone)rG   r   rS   rT   )rG   r   rS   zdict[str, Any])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r0   Ú__annotations__r   r   r4   rH   rC   Ú__static_attributes__Ú__classcell__)r;   s   @r<   r.   r.   6   sa   ø‡ ñð *:Ð˜Ó9ð "Ù#0£?Ø+/ð	

àð

ð !ð

ð )ð	

ð
 
÷

ð 

ô
÷&ò r>   r.   c                óæ   • U R                   nU R                  nU(       d  U0 4$ [        U5      [        L a  X!-  [        U04$  X!4-  nU[        U404$ ! [
         a    X!-  [        SU5      4s $ f = f)NzMapping[str, Any])r   r!   ÚtypeÚtupler   Ú	TypeErrorr   )rG   r   r!   Ú	formatteds       r<   rM   rM   w   s�   € Ø�;‰;€DØ
�*‰*€CæØ�BˆwˆäˆDƒz”UÒØ‰zÔ7¸Ð>Ð>Ð>ðAð ˜'‘Mˆ	ð Ô6¸¸Ð@Ð@Ð@øô ó ;ð ‰zœ4Ð 3°TÓ:Ð:Ò:ð	;ús   ÁA ÁA0Á/A0)rG   r   rS   ztuple[str, Mapping[str, Any]])&rY   Ú
__future__r   ÚbuiltinsÚ@py_builtinsÚ_pytest.assertion.rewriteÚ	assertionÚrewriteÚ
@pytest_arÚcollections.abcr   Úloggingr   r   rR   r   r   Útypingr	   r
   r   r   r6   Ú_internal.constantsr   r   r   r   r   Ú_internal.utilsr   Ú	frozensetr+   rZ   Ú r,   r.   rM   © r>   r<   Ú<module>rq      sd   ðÚ ;å "ç  „ Õ #ß OÓ Oß 5Ó 5ã ÷õ õ <ñ "+òó"€�ó ö8 Ýô>˜Nô >õBAr>   