o
    å/œhX  ã                   @   s    d Z ddlZejdfdd„ZdS )a_  
The logging options for yagmail. Note that the logger is set on the SMTP class.

The default is to only log errors. If wanted, it is possible to do logging with:

yag = SMTP()
yag.setLog(log_level = logging.DEBUG)

Furthermore, after creating a SMTP object, it is possible to overwrite and use your own logger by:

yag = SMTP()
yag.log = myOwnLogger
é    Nc                 C   sr   t  t¡}| t j¡ |rt  |¡}n| d u rt  ¡ g|_|S t  ¡ }| | ¡ t  	dd¡}| 
|¡ |g|_|S )Nz3%(asctime)s [yagmail] [%(levelname)s] : %(message)sz%Y-%m-%d %H:%M:%S)ÚloggingÚ	getLoggerÚ__name__ÚsetLevelÚERRORÚFileHandlerÚNullHandlerÚhandlersÚStreamHandlerÚ	FormatterÚsetFormatter)Ú	log_levelÚfile_path_nameÚloggerÚchÚ	formatter© r   ú?/var/www/html/myenv/lib/python3.10/site-packages/yagmail/log.pyÚ
get_logger   s   

ÿ
r   )Ú__doc__r   ÚDEBUGr   r   r   r   r   Ú<module>   s    