+
    õÉÍj   ã                   óî   € R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt Rt	Rt
RtRt]P                  ! ]P                  ]
]]P                  R7       RR	]]	]]P                  ]P                   R
R^R3R ltR# )af  Logging module.

This logging module is designed as a wrapper around the python `logging`
module.

When the module is loaded it configure the logging object with some
default parameters (log to stderr with DEBUG level).
After that, user can call the L{configure_logger} function and
configure logging to file and stderr.


# Usage

>>> import logging
>>> import tempfile
>>> from tea.logger import configure_logging
>>> configure_logging(filename=tempfile.mktemp())
>>> logger = logging.getLogger('test')
>>> logger.debug('Debug level log entry')
>>> logger.info('Info level log entry')
>>> logger.warning('Warn level log entry')
WARNING     - Warn level log entry [test:1]
>>> logger.error('Error level log entry')
ERROR       - Error level log entry [test:1]
>>> logger.critical('Critical level log entry')
CRITICAL    - Critical level log entry [test:1]
>>> try:
...     raise Exception('Test exception')
... except Exception:
...     logger.exception('Error level log entry with stack trace')
ERROR       - Error level log entry with stack trace [test:4]
Traceback (most recent call last):
  ...
Exception: Test exception
N)ÚRotatingFileHandler)ÚshellzL%(asctime)s.%(msecs)03d   %(levelname)11s: %(message)s [%(name)s:%(lineno)d]z>%(asctime)s %(levelname)11s: %(message)s [%(name)s:%(lineno)d]z4%(levelname)-11s - %(message)s [%(name)s:%(lineno)d]z%Y.%m.%d %H:%M:%S)ÚstreamÚformatÚdatefmtÚlevelÚaÚ i   Tc                óT  € \         P                  ! 4       p\         P                  Vn        V
'       dQ   \	        VP
                  4      ^ 8”  d7   VP
                  ^ ,          pVP                  4        VP                  V4       KP  Ven   \         P                  ! \        P                  4      pVP                  V4       \         P                  ! WB4      pVP                  V4       VP                  V4       V Ee0   \        P                   P#                  \        P                   P%                  V 4      4      p\        P                   P'                  V4      '       g   \(        P*                  ! V4       \-        WW‰4      pVP                  V4       \         P                  ! W24      p\.        P0                  Vn        VP                  V4       VP                  V4       V'       dE   RV,          pVP4                  P7                  RVP9                  ^dR4      ,           R,           4       R# R# R# )a	  Configure logging module.

Args:
    filename (str): Specifies a filename to log to.
    filemode (str): Specifies the mode to open the log file.
        Values: ``'a'``, ``'w'``. *Default:* ``a``.
    ts_fmt (str): Use the specified timestamp format.
    fmt (str): Format string for the file handler.
    stdout_fmt (str): Format string for the stdout handler.
    level (int): Log level for the file handler. Log levels are the same
        as the log levels from the standard :mod:`logging` module.
        *Default:* ``logging.DEBUG``
    stdout_level (int): Log level for the stdout handler. Log levels are
        the same as the log levels from the standard :mod:`logging` module.
        *Default:* ``logging.WARNING``
    initial_file_message (str): First log entry written in file.
    max_size (int): Maximal size of the logfile. If the size of the file
        exceed the maximal size it will be rotated.
    rotations_number (int): Number of rotations to save.
    remove_handlers (bool): Remove all existing handlers.
Nz %s Ú
Ú=z

)ÚloggingÚ	getLoggerÚNOTSETr   ÚlenÚhandlersÚcloseÚremoveHandlerÚStreamHandlerÚsysÚstdoutÚsetLevelÚ	FormatterÚsetFormatterÚ
addHandlerÚosÚpathÚabspathÚdirnameÚisdirr   Úmkdirr   ÚtimeÚgmtimeÚ	converterr   ÚwriteÚcenter)ÚfilenameÚfilemodeÚts_fmtÚfmtÚ
stdout_fmtr   Ústdout_levelÚinitial_file_messageÚmax_sizeÚrotations_numberÚremove_handlersÚloggerÚhdlrÚstdout_handlerÚstdout_formatterÚ	directoryÚfile_handlerÚfile_formatterÚmessages   &&&&&&&&&&&        Ú@/opt/data/home/.local/lib/python3.14/site-packages/tea/logger.pyÚconfigure_loggingr9   ;   s‰  € ôD ×ÒÓ €FÜ—>‘>€F„LçÜ�&—/‘/Ó" QÔ&Ø—?‘? 1Õ%ˆDØ�J‰JŒLØ× Ñ  Ö&àÒÜ ×.Ò.¬s¯z©zÓ:ˆØ×Ñ Ô-Ü"×,Ò,¨ZÓ@Ðà×#Ñ#Ð$4Ô5Ø×Ñ˜.Ô)àÓä—G‘G—O‘O¤B§G¡G§O¡O°HÓ$=Ó>ˆ	Ü�w‰w�}‰}˜Y×'Ò'Ü�KŠK˜	Ô"ä*Ø ó
ˆð 	×Ñ˜eÔ$Ü ×*Ò*¨3Ó7ˆÜ#'§;¡;ˆÔ Ø×!Ñ! .Ô1Ø×Ñ˜,Ô'ßØÐ3Õ3ˆGØ×Ñ×%Ñ% d¨W¯^©^¸CÀÓ-EÕ&EÈÕ&NÖOñ  ñ ó    )Ú__doc__r   r   r!   r   Úlogging.handlersr   Útear   ÚFMTÚ	FMT_SHORTÚ
FMT_STDOUTÚFMT_TSÚbasicConfigÚstderrÚDEBUGÚWARNINGr9   © r:   r8   Ú<module>rG      sŒ   ðñ"óH 
Û 
Û Û Ý 0å ðð ð M€	ØC€
Ø	€à × Ò Ø�:‰:˜i°¸w¿}¹}õð ØØØØØ
�-‰-Ø—‘ØØØØöCPr:   