
    Q4	              
           d Z dZdZddlZddlZdZdZdZdZd	Z	d
Z
dZdZdZdZdZej                   eej"                  e	ej$                  eej&                  eej(                  eiZ G d dej,                        Zy)z"
Logging facilities for aptdaemon
z%Sebastian Heinlein <devel@glatzor.de>ColoredFormatter    N          !   "   #   $   %   z[0mz[1;%dmz[1mc                       e Zd ZdZddZd Zy)r   zAdds some color to the log messages.

    http://stackoverflow.com/questions/384076/            how-can-i-color-python-logging-output
    Nc                     t         j                  j                  | ||       t        j                  d      dv r|| _        y d| _        y )NTERM)xtermzxterm-coloredlinuxF)logging	Formatter__init__osgetenv	use_color)selffmtdatefmtr   s       2/usr/lib/python3/dist-packages/aptdaemon/logger.pyr   zColoredFormatter.__init__=   s:    ""4g699V CC&DN"DN    c                    | j                   r|j                  t        v rt        t        |j                     z  |j                  z   t
        z   |_        t        t        z  |j                  z   t
        z   |_        |j                  t        j                  t        j                  fv r&t        t        z  |j                  z   t
        z   |_        t        j                  j                  | |      S )z"Return the formated output string.)r   levelnoCOLORS	COLOR_SEQ	levelname	RESET_SEQGREENnamer   CRITICALERRORREDmsgr   format)r   records     r   r(   zColoredFormatter.formatD   s    >>fnn6 )F6>>,B B & 0 0!1 )!*F $e+fkk9IEFK~~'"2"2GMM!BB&_vzz9IE
  ''f55r   )NNT)__name__
__module____qualname____doc__r   r(    r   r   r   r   5   s    #	6r   )r-   
__author____all__r   r   BLACKr&   r"   YELLOWBLUEMAGENTACYANWHITEr!   r   BOLD_SEQWARNINFODEBUGr$   r%   r   r   r   r.   r   r   <module>r;      s   & 5
  	 	
		
	
 		 LL&LL$MM4cMM3
6w(( 6r   