+
    ‚V@iÐ"  ã                   ó0  € ^ 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	t	^ RI
Ht ^ RIHtHtHt ^ RIHt ^ RIHt ] P(                  R 4       t ! R R]P,                  4      t ! R	 R
]P,                  4      t ! R R]P,                  4      tR# )é    N)Úutf8)ÚLogFormatterÚdefine_logging_optionsÚenable_pretty_logging)ÚOptionParser)Úbasestring_typec               #   óÂ   "  € \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        R7       Rx € RRR4       R#   + '       g   i     R# ; i5i)Úignore)ÚcategoryN)ÚwarningsÚcatch_warningsÚsimplefilterÚBytesWarning© ó    Ú7/usr/lib/python3/dist-packages/tornado/test/log_test.pyÚignore_bytes_warningr       s5   é € ä	×	 Ò	 ×	"Õ	"Ü×Ò˜h´Õ>Û÷ 
#×	"×	"Ò	"üs   ‚A !AÁ
AÁA	Á	Ac                   óz   a € ] tR t^'t o ]P
                  ! R4      tR tR tR t	R t
R tR tR tR	 tR
 tRtV tR# )ÚLogFormatterTestsD   (?s)\[E [0-9]{6} [0-9]{2}:[0-9]{2}:[0-9]{2} log_test:[0-9]+\] (.*)c                óJ  € \        R R7      V n        \        P                  R/V P                  n        RV P                  n        \        P                  ! R4      V n        R V P                  n        \        P                  ! 4       V n        \        P                  P                  V P                  R4      V n        V P!                  V P                  4      V n        V P"                  P%                  V P                  4       V P                  P'                  V P"                  4       R# )F)ÚcolorÚÚr   zlog.outN)r   Ú	formatterÚloggingÚERRORÚ_colorsÚ_normalÚLoggerÚloggerÚ	propagateÚtempfileÚmkdtempÚtempdirÚosÚpathÚjoinÚfilenameÚmake_handlerÚhandlerÚsetFormatterÚ
addHandler©Úselfs   &r   ÚsetUpÚLogFormatterTest.setUp.   sº   € Ü%¨EÔ2ˆŒô
 #*§-¡-°Ð!:ˆ�‰ÔØ!)ˆ�‰Ôä—n’nÐ%7Ó8ˆŒØ %ˆ�‰ÔÜ×'Ò'Ó)ˆŒÜŸ™Ÿ™ T§\¡\°9Ó=ˆŒØ×(Ñ(¨¯©Ó7ˆŒØ�‰×!Ñ! $§.¡.Ô1Ø�‰×Ñ˜tŸ|™|Ö,r   c                óº   € V P                   P                  4        \        P                  ! V P                  4       \        P
                  ! V P                  4       R # ©N)r*   Úcloser%   Úunlinkr(   Úrmdirr$   r-   s   &r   ÚtearDownÚLogFormatterTest.tearDown?   s2   € Ø�‰×ÑÔÜ
�	Š	�$—-‘-Ô Ü
�Š�—‘Ör   c                ó2   € \         P                  ! VR R7      # )úutf-8©Úencoding)r   ÚFileHandler)r.   r(   s   &&r   r)   ÚLogFormatterTest.make_handlerD   s   € Ü×"Ò" 8°gÔ>Ð>r   c                óL  € \        V P                  R 4      ;_uu_ 4       pVP                  4       P                  4       p\        P
                  P                  V4      pV'       d   VP                  ^4      uuRRR4       # \        RV,          4      h  + '       g   i     R# ; i)ÚrbNzoutput didn't match regex: %r)	Úopenr(   ÚreadÚstripr   ÚLINE_REÚmatchÚgroupÚ	Exception)r.   ÚfÚlineÚms   &   r   Ú
get_outputÚLogFormatterTest.get_outputG   sr   € Ü�$—-‘- ×&Ô&¨!Ø—6‘6“8—>‘>Ó#ˆDÜ ×(Ñ(×.Ñ.¨tÓ4ˆAßØ—w‘w˜q“z÷	 'Ò&ô  Ð ?À$Õ FÓGÐG÷ '×&Ð&ús   ŸABÂ BÂB#	c                ó|   € V P                   P                  R 4       V P                  V P                  4       R4       R# )Úfoos   fooN)r    ÚerrorÚassertEqualrJ   r-   s   &r   Útest_basic_loggingÚ#LogFormatterTest.test_basic_loggingP   s+   € Ø�‰×Ñ˜%Ô Ø×Ñ˜Ÿ™Ó*¨FÖ3r   c           
     óþ   € \        4       ;_uu_ 4        V P                  P                  R 4       V P                  V P	                  4       \        \        R 4      4      4       RRR4       R#   + '       g   i     R# ; i)ó   éN)r   r    rN   rO   rJ   r   Úreprr-   s   &r   Útest_bytes_loggingÚ#LogFormatterTest.test_bytes_loggingT   sL   € Ü!×#Õ#à�K‰K×Ñ˜gÔ&Ø×Ñ˜TŸ_™_Ó.´´T¸'³]Ó0CÔD÷ $×#×#Ò#ús   “AA+Á+A<	c           
     ó´  € \        4       ;_uu_ 4        V P                  P                  R P                  4       4       RRR4       \	        \
        \        4      '       d,   V P                  V P                  4       \        R 4      4       R# V P                  V P                  4       \        \        \        R 4      4      4      4       R#   + '       g   i     L’; i©ô   Ã©N)r   r    rN   ÚencodeÚ
issubclassÚbytesr   rO   rJ   r   rT   r-   s   &r   Útest_utf8_loggingÚ"LogFormatterTest.test_utf8_loggingZ   sƒ   € Ü!×#Õ#Ø�K‰K×Ñ˜hŸo™oÓ/Ô0÷ $ä”eœ_×-Ò-ð ×Ñ˜TŸ_™_Ó.´°X³Ö?ð
 ×Ñ˜TŸ_™_Ó.´´T¼$¸x».Ó5IÓ0JÖK÷ $×#ús   “*CÃC	c                óÞ   €  \        R 4      h  \          d    T P                  P                  R4        Mi ; iT P                  4       pT P	                  TR4       T P                  RT4       R# )rS   zcaught exceptions   Exception.*\\xe9s   \nN)rF   r    Ú	exceptionrJ   ÚassertRegexÚassertNotIn)r.   Úoutputs   & r   Útest_bytes_exception_loggingÚ-LogFormatterTest.test_bytes_exception_loggingg   sc   € ð	6Ü˜GÓ$Ð$øÜô 	6Ø�K‰K×!Ñ!Ð"4Ö5ð	6úð —‘Ó"ˆØ×Ñ˜Ð!5Ô6à×Ñ˜ Ö(s   ‚ �&6µ6c                óŽ   € V P                   P                  R 4       V P                  V P                  4       \	        R 4      4       R# rX   )r    rN   rO   rJ   r   r-   s   &r   Útest_unicode_loggingÚ%LogFormatterTest.test_unicode_loggings   s/   € Ø�‰×Ñ˜(Ô#Ø×Ñ˜Ÿ™Ó*¬D°«NÖ;r   )r(   r   r*   r    r$   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚreÚcompilerC   r/   r6   r)   rJ   rP   rU   r]   rd   rg   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r   '   sM   ø‡ € ð �jŠjØWó€Gò-ò"ò
?òHò4òEòLò
)÷<ð <r   r   c                   óD   a a€ ] tR t^xt oV 3R ltR tR tR tRtVt	V ;t
# )ÚEnablePrettyLoggingTestc                óÄ   <€ \         SV `  4        \        4       V n        \	        V P                  4       \
        P                  ! R 4      V n        RV P                  n        R# )z-tornado.test.log_test.EnablePrettyLoggingTestFN)	Úsuperr/   r   Úoptionsr   r   r   r    r!   )r.   Ú	__class__s   &€r   r/   ÚEnablePrettyLoggingTest.setUpy   s>   ø€ Ü‰‰ŒÜ#“~ˆŒÜ˜tŸ|™|Ô,Ü—n’nÐ%TÓUˆŒØ %ˆ�‰Ör   c                óì  € \         P                  ! 4       p VR ,           V P                  n        \	        V P                  V P
                  R7       V P                  ^\        V P
                  P                  4      4       V P
                  P                  R4       V P
                  P                  ^ ,          P                  4        \        P                  ! VR,           4      pV P                  ^\        V4      4       \        V^ ,          RR7      ;_uu_ 4       pV P                  VP                  4       R4       RRR4       V P
                  P                   F#  pVP                  4        VP                  4        K%  	  \        P                  ! VR,           4       F  p\         P"                  ! V4       K  	  \         P$                  ! V4       R#   + '       g   i     LŸ; i  T P
                  P                   F#  pTP                  4        TP                  4        K%  	  \        P                  ! TR,           4       F  p\         P"                  ! T4       K  	  \         P$                  ! T4       i ; i)ú	/test_log©rw   r    Úhelloú
/test_log*r9   r:   ú^\[E [^]]*\] hello$N)r"   r#   rw   Úlog_file_prefixr   r    rO   ÚlenÚhandlersrN   ÚflushÚglobr@   ra   rA   r3   r%   r4   r5   ©r.   ÚtmpdirÚ	filenamesrG   r*   r(   s   &     r   Útest_log_fileÚ%EnablePrettyLoggingTest.test_log_file€   s˜  € Ü×!Ò!Ó#ˆð	Ø+1°KÕ+?ˆD�L‰LÔ(Ü!¨$¯,©,¸t¿{¹{ÕKØ×Ñ˜Q¤ D§K¡K×$8Ñ$8Ó 9Ô:Ø�K‰K×Ñ˜gÔ&Ø�K‰K× Ñ  Õ#×)Ñ)Ô+ÜŸ	š	 &¨<Õ"7Ó8ˆIØ×Ñ˜Q¤ I£Ô/Ü�i •l¨W×5Õ5¸Ø× Ñ  §¡£Ð+AÔB÷ 6ð  Ÿ;™;×/Ô/�Ø—‘”Ø—‘–ñ 0ô !ŸIšI f¨|Õ&;Ö<�Ü—	’	˜(Ö#ñ =ä�HŠH�VÖ÷ 6×5ûð  Ÿ;™;×/Ô/�Ø—‘”Ø—‘–ñ 0ô !ŸIšI f¨|Õ&;Ö<�Ü—	’	˜(Ö#ñ =ä�HŠH�VÕús%   —DG$ Ä!GÄ:G$ ÇG!	ÇG$ Ç$BI3c                ó°  € \         P                  ! 4       p VR ,           V P                  n        RV P                  n        \        V P                  V P                  R7       V P                  P                  R4       V P                  P                  ^ ,          P                  4        \        P                  ! VR,           4      pV P                  ^\        V4      4       \        V^ ,          RR7      ;_uu_ 4       pV P                  VP                  4       R4       RRR4       V P                  P                   F#  pVP                  4        VP!                  4        K%  	  \        P                  ! VR,           4       F  p\"        P$                  ! V4       K  	  \"        P&                  ! V4       R#   + '       g   i     LŸ; i  T P                  P                   F#  pTP                  4        TP!                  4        K%  	  \        P                  ! TR,           4       F  p\"        P$                  ! T4       K  	  \"        P&                  ! T4       i ; i)	r{   Útimer|   r}   r~   r9   r:   r   N)r"   r#   rw   r€   Úlog_rotate_moder   r    rN   r‚   rƒ   r„   rO   r�   r@   ra   rA   r3   r%   r4   r5   r…   s   &     r   Ú!test_log_file_with_timed_rotatingÚ9EnablePrettyLoggingTest.test_log_file_with_timed_rotating”   s…  € Ü×!Ò!Ó#ˆð	Ø+1°KÕ+?ˆD�L‰LÔ(Ø+1ˆD�L‰LÔ(Ü!¨$¯,©,¸t¿{¹{ÕKØ�K‰K×Ñ˜gÔ&Ø�K‰K× Ñ  Õ#×)Ñ)Ô+ÜŸ	š	 &¨<Õ"7Ó8ˆIØ×Ñ˜Q¤ I£Ô/Ü�i •l¨W×5Õ5¸Ø× Ñ  §¡£Ð+AÔB÷ 6ð  Ÿ;™;×/Ô/�Ø—‘”Ø—‘–ñ 0ô !ŸIšI f¨|Õ&;Ö<�Ü—	’	˜(Ö#ñ =ä�HŠH�VÖ÷ 6×5ûð  Ÿ;™;×/Ô/�Ø—‘”Ø—‘–ñ 0ô !ŸIšI f¨|Õ&;Ö<�Ü—	’	˜(Ö#ñ =ä�HŠH�VÕús%   —C$G Ã;!F3ÄG Æ3G	Æ>G ÇBIc                ó¬  €  R V P                   n        RV P                   n        V P                  \        \
        V P                   V P                  R7       V P                  P                   F#  pVP                  4        VP                  4        K%  	  R#   T P                  P                   F#  pTP                  4        TP                  4        K%  	  i ; i)Ú	some_pathÚ
wrong_moder|   N)
rw   r€   rŒ   ÚassertRaisesÚ
ValueErrorr   r    r‚   rƒ   r3   )r.   r*   s   & r   Útest_wrong_rotate_mode_valueÚ4EnablePrettyLoggingTest.test_wrong_rotate_mode_value¨   s•   € ð	 Ø+6ˆD�L‰LÔ(Ø+7ˆD�L‰LÔ(Ø×ÑÜÜ%ØŸ™Ø—{‘{ð	 ô ð  Ÿ;™;×/Ô/�Ø—‘”Ø—‘–ó 0ø˜4Ÿ;™;×/Ô/�Ø—‘”Ø—‘–ò 0ús   ‚AB Â?C)r    rw   )ri   rj   rk   rl   r/   rˆ   r�   r”   ro   rp   Ú__classcell__)rx   rr   s   @@r   rt   rt   x   s   ù‡ € õ&òò(÷( ò  r   rt   c                   óX   a € ] tR t^¸t o RtRR ltR tR tR tR t	R t
R	 tR
 tRtV tR# )ÚLoggingOptionTestz?Test the ability to enable and disable Tornado's logging hooks.Nc                óT  € R pRpRP                  W1V.4      p\        P                  ! \        P                  RV.T;'       g    . ,           \        P
                  \        P                  R7      pVP                  4       w  rxV P                  VP                  ^ RV,          4       RV9   # )z7from tornado.options import options, parse_command_linez%import logging; logging.info("hello")Ú;z-c)ÚstdoutÚstderrzprocess failed: %rs   hello)
r'   Ú
subprocessÚPopenÚsysÚ
executableÚPIPEÚSTDOUTÚcommunicaterO   Ú
returncode)	r.   Ú	statementÚargsÚIMPORTÚLOG_INFOÚprogramÚprocr›   rœ   s	   &&&      r   Úlogs_presentÚLoggingOptionTest.logs_present»   s”   € ð KˆØ:ˆØ—(‘(˜F¨xÐ8Ó9ˆÜ×ÒÜ�^‰^˜T 7Ð+¨t¯z¨z°rÕ:Ü—?‘?Ü×$Ñ$ô
ˆð
 ×)Ñ)Ó+‰ˆØ×Ñ˜Ÿ™¨!Ð-AÀFÕ-JÔKØ˜6Ñ!Ð!r   c                óF   € V P                  V P                  R 4      4       R# )ÚpassN©ÚassertFalser«   r-   s   &r   Útest_defaultÚLoggingOptionTest.test_defaultÍ   s   € Ø×Ñ˜×*Ñ*¨6Ó2Ö3r   c                óF   € V P                  V P                  R 4      4       R# )úparse_command_line()N©Ú
assertTruer«   r-   s   &r   Útest_tornado_defaultÚ&LoggingOptionTest.test_tornado_defaultÐ   s   € Ø�‰˜×)Ñ)Ð*@ÓAÖBr   c                óJ   € V P                  V P                  R R.4      4       R# )r´   z--logging=noneNr¯   r-   s   &r   Útest_disable_command_lineÚ+LoggingOptionTest.test_disable_command_lineÓ   ó"   € Ø×Ñ˜×*Ñ*Ð+AÐDTÐCUÓVÖWr   c                óJ   € V P                  V P                  R R.4      4       R# )r´   z--logging=NoneNr¯   r-   s   &r   Ú*test_disable_command_line_case_insensitiveÚ<LoggingOptionTest.test_disable_command_line_case_insensitiveÖ   r¼   r   c                óF   € V P                  V P                  R 4      4       R# )z.options.logging = "none"; parse_command_line()Nr¯   r-   s   &r   Útest_disable_code_stringÚ*LoggingOptionTest.test_disable_code_stringÙ   s   € Ø×ÑØ×ÑÐNÓOö	
r   c                óF   € V P                  V P                  R 4      4       R# )ú,options.logging = None; parse_command_line()Nr¯   r-   s   &r   Útest_disable_code_noneÚ(LoggingOptionTest.test_disable_code_noneÞ   s   € Ø×ÑØ×ÑÐLÓMö	
r   c                óJ   € V P                  V P                  R R.4      4       R# )rÄ   z--logging=infoNrµ   r-   s   &r   Útest_disable_overrideÚ'LoggingOptionTest.test_disable_overrideã   s%   € à�‰Ø×ÑØ>ÐAQÐ@Róö	
r   r   r2   )ri   rj   rk   rl   Ú__doc__r«   r±   r·   rº   r¾   rÁ   rÅ   rÈ   ro   rp   rq   s   @r   r˜   r˜   ¸   s8   ø‡ € ÙIô"ò$4òCòXòXò
ò

÷

ð 
r   r˜   )Ú
contextlibr„   r   r%   rm   r�   rŸ   r"   Úunittestr   Útornado.escaper   Útornado.logr   r   r   Útornado.optionsr   Útornado.utilr   Úcontextmanagerr   ÚTestCaser   rt   r˜   r   r   r   Ú<module>rÓ      sˆ   ðó Û Û Û 	Û 	Û Û 
Û Û Û å ß SÑ SÝ (Ý (ð ×Ññó ðôN<�x×(Ñ(ô N<ôb= ˜h×/Ñ/ô = ô@1
˜×)Ñ)ö 1
r   