+
    ˜qgj1  ã                   ón  € ^ RI t^ RIt^ RIt^ 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 ^ RIHt Rt^#t]P"                  ^,
          t ! R R]P&                  4      t]P"                  R3R ltR	 tR
 R ltRR lt ! R R]P2                  4      tR tR t ! R R]P:                  4      tR tR# )é    N)Údefaultdict)Úsuppress)ÚDefaultDictz6%(asctime)s - %(filename)s[%(levelname)s]: %(message)sc                   ó0   a € ] tR t^t o RtR tR tRtV tR# )ÚCustomLoggerTypezëA hack to get mypy to stop complaining about custom logging methods.

When using deprecated or trace logging, rather than:
    LOG = logging.getLogger(__name__)
Instead do:
    LOG = cast(CustomLoggerType, logging.getLogger(__name__))
c                ó   € R # ©N© ©ÚselfÚargsÚkwargss   &*,Ú7/usr/lib/python3/dist-packages/cloudinit/log/loggers.pyÚtraceÚCustomLoggerType.trace&   ó   € Ùó    c                ó   € R # r	   r
   r   s   &*,r   Ú
deprecatedÚCustomLoggerType.deprecated)   r   r   r
   N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      s   ø‡ € ñò÷ð r   r   c                 óH  € T;'       g    \         P                  ! \        4      p\         P                  ! 4       p\         P                  ! \
        P                  4      pVP                  V4       VP                  V 4       VP                  V4       VP                  V 4       R # r	   )
ÚloggingÚ	FormatterÚDEFAULT_LOG_FORMATÚ	getLoggerÚStreamHandlerÚsysÚstderrÚsetFormatterÚsetLevelÚ
addHandler)ÚlevelÚ	formatterÚrootÚconsoles   &&  r   Úsetup_basic_loggingr/   -   sq   € Ø×BÐBœW×.Ò.Ô/AÓB€IÜ×ÒÓ€DÜ×#Ò#¤C§J¡JÓ/€GØ×Ñ˜Ô#Ø×Ñ�UÔØ‡O�O�GÔØ‡M�M�%Ör   c                 ó6  € V '       g   R # V P                    FU  p\        V\        P                  4      '       g   K%  \	        \
        4      ;_uu_ 4        VP                  4        R R R 4       KW  	  \        V P                  4       R #   + '       g   i     K�  ; ir	   )	ÚhandlersÚ
isinstancer!   r%   r   ÚIOErrorÚflushÚflush_loggersÚparent)r-   Úhs   & r   r5   r5   7   s_   € ßÙØ�]Œ]ˆÜ�aœ'×/Ñ/×1Ô1Üœ'×"Õ"Ø—‘”	÷ #Ñ"ñ ô �$—+‘+Ö÷ #×"Ð"ús   ÁBÂBc                ó   € V ^8„  d   QhRR/# )é   ÚreturnNr
   )Úformats   "r   Ú__annotate__r<   A   s   € ÷ 8ñ 8˜dñ 8r   c                 ó  € R p \         P                  ! \        R4       \         P                  ! \        R4       \	        \         P
                  RV ! \        4      4       \	        \         P
                  RV ! \        4      4       R# )z:Add DEPRECATED and TRACE log levels to the logging module.c                 ó   a € V 3R  lpV# )c                 ób   <€ V P                  S4      '       d   V P                  ! SW3/ VB  R # R # r	   )ÚisEnabledForÚ_log)r   Úmessager   r   r+   s   &&*,€r   Úlog_at_levelÚ>define_extra_loggers.<locals>.new_logger.<locals>.log_at_levelE   s,   ø€ Ø× Ñ  ×'Ò'Ø—	’	˜% Ñ9°&Ô9ñ (r   r
   )r+   rC   s   f r   Ú
new_loggerÚ(define_extra_loggers.<locals>.new_loggerD   s   ø€ õ	:ð Ðr   Ú
DEPRECATEDÚTRACEr   r   N)r!   ÚaddLevelNamerG   rH   ÚsetattrÚLogger)rE   s    r   Údefine_extra_loggersrL   A   sS   € òô ×Òœ \Ô2Ü×Òœ Ô(ÜŒG�N‰N˜L©*´ZÓ*@ÔAÜŒG�N‰N˜G¡Z´Ó%6Ö7r   c                 óJ  € V '       g   / p \         P                  ! 4       p\        4       pVP                  \         P                  4       . pV P                  R 4      pV'       d2   \        V\        4      '       d   VP                  \        V4      4       MÀRV 9   dº   V R,           F¬  p\        V\        4      '       d   VP                  V4       K,  \        V\        P                  P                  4      '       d=   V Uu. uF  p\        V4      NK  	  ppVP                  RP                  V4      4       K’  VP                  \        V4      4       K®  	  ^ pV F°  p\        \        4      ;_uu_ 4        V^,          pVP                  R4      '       d&   \         P"                  P%                  V4      '       g   \&        P(                  ! V4      p\         P*                  P-                  V4       VP/                  V4        RRR4        R# 	  VP/                  V4       V P                  RR4      p	\0        P2                  P5                  RV,          4       V	'       d,   \0        P2                  P5                  R4       \7        4        R# R# u upi   + '       g   i     EKI  ; i)	ÚlogcfgÚlog_cfgsÚ
Ú/NÚ	log_basicTz0WARN: no logging configured! (tried %s configs)
zSetting up basic logging...
)r!   r$   ÚLogExporterr)   ÚWARNÚgetr2   ÚstrÚappendÚcollectionsÚabcÚIterableÚjoinr   ÚFileNotFoundErrorÚ
startswithÚosÚpathÚisfileÚioÚStringIOÚconfigÚ
fileConfigr*   r&   r'   Úwriter/   )
ÚcfgÚroot_loggerÚexporterrO   Úlog_cfgÚa_cfgÚcÚcfg_strÚam_triedÚbasic_enableds
   &         r   Úsetup_loggingro   Q   sé  € çØˆä×#Ò#Ó%€KÜ‹}€HØ×Ñ”g—l‘lÔ#à€HØ�g‰g�hÓ€Gß”:˜g¤s×+Ò+ð 	�‰œ˜G›Õ%Ø	�sÔ	Ø˜—_�_ˆEÜ˜%¤×%Ò%Ø—‘ Ö&Ü˜E¤K§O¡O×$<Ñ$<×>Ò>Ù+0Ó1©5 aœ3˜qž6©5�Ð1Ø—‘ §	¡	¨'Ó 2Ö3à—‘¤ E£
Ö+ñ %ð €Hó
 ˆô Ô'×(Õ(Ø˜�MˆHð ×&Ñ& s×+Ò+´·±·±¸w×0GÒ0GÜŸ+š+ gÓ.�ô �N‰N×%Ñ% gÔ.ð ×"Ñ" 8Ô,ð ÷ )Ò(ñ	 ð* ×Ñ˜8Ô$ð —G‘G˜K¨Ó.€Mä‡J�J×ÑØ;¸xÕHô÷ Ü�
‰
×ÑÐ8Ô9ÜÖñ ùòQ 2÷ )×(Ñ(ús   Ã?JÅ3AJÆ9AJÊJ"c                   ó`   a € ] tR t^’t o ]! ]4      tV 3R lR ltR tR t	R t
V 3R ltRtV tR# )	rS   c                ó4   <€ V ^8„  d   QhRS[ P                  /# )r9   Úrecord)r!   Ú	LogRecord)r;   r   s   "€r   r<   ÚLogExporter.__annotate__•   s   ø€ ÷ Bñ B™7×,Ñ,ñ Br   c                óz   € V P                   VP                  ,          P                  VP                  4       4       R # r	   )ÚholderÚ	levelnamerW   Ú
getMessage)r   rr   s   &&r   ÚemitÚLogExporter.emit•   s(   € Ø�‰�F×$Ñ$Õ%×,Ñ,¨V×->Ñ->Ó-@ÖAr   c                óB   € \         P                  ! V P                  4      # r	   )ÚcopyÚdeepcopyrv   ©r   s   &r   Úexport_logsÚLogExporter.export_logs˜   s   € Ü�}Š}˜TŸ[™[Ó)Ð)r   c                ó.   € \        \        4      V n        R # r	   )r   Úlistrv   r~   s   &r   Ú
clean_logsÚLogExporter.clean_logs›   s   € Ü!¤$Ó'ˆŽr   c                ó   € R # r	   r
   r~   s   &r   r4   ÚLogExporter.flushž   r   r   c                ó<   <€ V ^8„  d   Qh/ S[ S[S[3,          ;R&   # )r9   rv   )r   rV   r‚   )r;   r   s   "€r   r<   rt   ’   s   ø‡ ‚ Ù™™T˜	Õ"Ñ6ò r   )rv   N)r   r   r   r   r   r‚   rv   ry   r   rƒ   r4   Ú__annotate_func__r   r   r   s   @r   rS   rS   ’   s1   ø‡ € Ù%0°Ó%6€F÷Bð Bò*ò(ò÷ ƒ r   rS   c                 ó  € \         P                  ! 4       p \        V P                  4      pV F4  pVP	                  4        VP                  4        V P                  V4       K6  	  V P                  \         P                  4       R# )z0Remove all current handlers and unset log level.N)	r!   r$   r‚   r1   r4   ÚcloseÚremoveHandlerr)   ÚNOTSET)Úlogr1   r7   s      r   Úreset_loggingrŽ   ¢   sZ   € ä
×
Ò
Ó
€CÜ�C—L‘LÓ!€HÛˆØ	�‰Œ	Ø	�‰Œ	Ø×Ñ˜!Öñ ð ‡L�L”—‘Ö r   c                 óø   a€ \         P                  ! \        P                  4      o\	        SRR 4       SP                  \         P                  ! R4      4       V3R lp \	        \         P                  RV 4       R# )z«In the event that internal logging exception occurs and logging is not
possible for some reason, make a desperate final attempt to log to stderr
which may ease debugging.
ÚhandleErrorc                 ó   € R # r	   r
   )rr   s   &r   Ú<lambda>Ú&setup_backup_logging.<locals>.<lambda>³   s   € ¹Dr   z@FALLBACK: %(asctime)s - %(filename)s[%(levelname)s]: %(message)sc                ó²   <€ \        \        4      ;_uu_ 4        SP                  V4       SP                  4        RRR4       R#   + '       g   i     R# ; i)z;A closure that emits logs on stderr when other methods failN)r   r3   Úhandler4   )r   rr   Úfallback_handlers   &&€r   r�   Ú)setup_backup_logging.<locals>.handleErrorº   s7   ø€ ä”g×ÕØ×#Ñ# FÔ+Ø×"Ñ"Ô$÷ ××Òús   ™"AÁA	N)r!   r%   r&   r'   rJ   r(   r"   ÚHandler)r�   r–   s    @r   Úsetup_backup_loggingr™   ­   s^   ø€ ô
 ×,Ò,¬S¯Z©ZÓ8ÐÜÐ˜mÑ-@ÔAØ×!Ñ!Ü×ÒØNó	
ôõ%ô ŒG�O‰O˜]¨KÖ8r   c                   ó6   a a€ ] tR t^Ãt oRtV 3R ltRtVtV ;t# )ÚCloudInitLogRecordzŠreporting the filename as __init__.py isn't very useful in logs

if the filename is __init__.py, use the parent directory as the filename
c                óä   <€ \         SV `  ! V/ VB  R V P                  8X  dN   \        P                  P                  \        P                  P                  V P                  4      4      V n        R# R# )z__init__.pyN)ÚsuperÚ__init__Úfilenamer^   r_   ÚbasenameÚdirnameÚpathname)r   r   r   Ú	__class__s   &*,€r   rž   ÚCloudInitLogRecord.__init__É   sM   ø€ Ü‰Ò˜$Ð) &Ò)Ø˜DŸM™MÔ)ÜŸG™G×,Ñ,¬R¯W©W¯_©_¸T¿]¹]Ó-KÓLˆDŽMñ *r   )rŸ   )	r   r   r   r   r   rž   r   r   Ú__classcell__)r£   r   s   @@r   r›   r›   Ã   s   ù‡ € ñ÷
Mõ Mr   r›   c                 óV  € \         P                  \        P                  n        \        4        \        4        \        4        \        4       p V P                  \        P                  4       \        P                  ! 4       P                  V 4       \        P                  ! \        4       R# )z(Customize the root logger for cloud-initN)ÚtimeÚgmtimer!   r"   Ú	converterrL   r™   rŽ   rS   r)   rT   r$   r*   ÚsetLogRecordFactoryr›   )Úhandlers    r   Úconfigure_root_loggerr¬   Ï   sj   € ô #'§+¡+„G×ÑÔÜÔÜÔÜ„Oô ‹m€GØ×Ñ”W—\‘\Ô"Ü×ÒÓ×"Ñ" 7Ô+ô ×ÒÔ 2Ö3r   r	   ) Úcollections.abcrX   r|   ra   r!   Úlogging.configÚlogging.handlersr^   r&   r§   r   Ú
contextlibr   Útypingr   r#   rG   ÚDEBUGrH   rK   r   r/   r5   rL   ro   r%   rS   rŽ   r™   rs   r›   r¬   r
   r   r   Ú<module>r³      s©   ðó Û Û 	Û Û Û Û 	Û 
Û Ý #Ý Ý àMÐ Ø€
Ø�‰˜Õ€ô�w—~‘~ô ð  &Ÿm™m°tô òõ8ô >ôB�'×'Ñ'ô ò !ò9ô,	M˜×*Ñ*ô 	Mô4r   