3 Ø ÷^±c@sldZdZdZdZdZdZddlZGdd „d ƒZeƒZej Z ej Z ej Z ej Z ej Z ejZd d „Zd d „ZdS)z,A simple log mechanism styled after PEP 282.ééiiiéNc@sPeZdZefdd„Zdd„Zdd„Zdd„Zd d „Zd d „Z d d„Z dd„Z dS)ÚLogcCs ||_dS©N)Ú threshold)Úselfr©rú%/usr/lib64/python3.6/distutils/log.pyÚ__init__óz Log.__init__c Cs®|tttttfkr"tdt|ƒƒ‚||jkrª|r8||}|tttfkrNtj }ntj }y|j d|ƒWn:t k r |j }|j|dƒj|ƒ}|j d|ƒYnX|jƒdS)Nz%s wrong log levelz%s Zbackslashreplace)ÚDEBUGÚINFOÚWARNÚERRORÚFATALZ ValueErrorZstrrÚsysZstderrZstdoutZwriteZUnicodeEncodeErrorÚencodingZencodeZdecodeZflush)rÚlevelÚmsgÚargsZstreamrrrrÚ_logs zLog._logcGs|j|||ƒdSr)r)rrrrrrrÚlog'r zLog.logcGó|jt||ƒdSr)rr ©rrrrrrÚdebug*r z Log.debugcGrr)rr rrrrÚinfo-r zLog.infocGrr)rr rrrrÚwarn0r zLog.warncGrr)rrrrrrÚerror3r z Log.errorcGrr)rrrrrrÚfatal6r z Log.fatalN) Z__name__Z __module__Z __qualname__r r rrrrrrrrrrrrs rcCstj}|t_|Sr)Ú _global_logr)rZoldrrrÚ set_thresholdAsrcCs8|dkrttƒn"|dkr$ttƒn|dkr4ttƒdS)Nrrr)rr r r )ZvrrrÚ set_verbosityGs   r )Z__doc__r r r rrrrrrrrrrrrr rrrrZs +