Ë
    À7jÃ  ã                  óv   — d Z ddlmZ ddlZddlZddlmZ ddlmZ dZ	da
dej                  fdd„Zdd	„Zdd
„Zy)zðStructured logging for the agent.

Logs go to both stdout (useful in CLI mode) and the rotating agent log file.
A redact() helper masks token-like values; callers must NEVER pass raw secrets
to the logger. See SECURITY rules in the README.
é    )ÚannotationsN)ÚRotatingFileHandler)ÚPathz0%(asctime)s %(levelname)-7s %(name)s %(message)sFc                ó  — t         ryt        j                  d«      }|j                  |«       t        j                  t
        «      }t        j                  t        j                  «      }|j                  |«       |j                  |«       | �R	 | j                  j                  dd¬«       t        | ddd¬«      }|j                  |«       |j                  |«       da yda y# t        $ r}|j                  d	| |«       Y d}~da yd}~ww xY w)
z9Configure root logging once. Safe to call multiple times.NÚ	wolfpanelT)ÚparentsÚexist_oki  P é   zutf-8)ÚmaxBytesÚbackupCountÚencodingzfile logging disabled (%s): %s)Ú_configuredÚloggingÚ	getLoggerÚsetLevelÚ	FormatterÚ_LOG_FORMATÚStreamHandlerÚsysÚstdoutÚsetFormatterÚ
addHandlerÚparentÚmkdirr   ÚOSErrorÚwarning)Úlog_fileÚlevelÚrootÚ	formatterÚstreamÚfile_handlerÚexcs          ú@/var/www/downloads.wolfpanel.net/public_html/agent/src/logger.pyÚsetup_loggingr%      sð   € õ Øä×Ñ˜[Ó)€DØ‡M�M�%ÔÜ×!Ñ!¤+Ó.€Iä×"Ñ"¤3§:¡:Ó.€FØ
×Ñ˜	Ô"Ø‡O�O�FÔð Ðð	JØ�O‰O×!Ñ!¨$¸Ð!Ô>Ü.Ø ?ÀÈGôˆLð ×%Ñ% iÔ0Ø�O‰O˜LÔ)ð �K�$�Køô ò 	JØ�L‰LÐ9¸8ÀS×IÐIà�Kûð	Jús   ÂAC# Ã#	DÃ,DÄDc                ó2   — t        j                  d| › �«      S )z6Return a namespaced logger under the 'wolfpanel' root.z
wolfpanel.)r   r   )Únames    r$   Ú
get_loggerr(   1   s   € ä×Ñ˜z¨$¨Ð0Ó1Ð1ó    c                ó@   — | syt        | «      dk  ry| dd › d| dd › �S )zBMask a secret for safe display in logs (never log the full value).z<none>é   z****Né   z...éþÿÿÿ)Úlen)Úsecrets    r$   Úredactr0   6   s4   € áØÜ
ˆ6ƒ{�aÒØØ�R�aˆjˆ\˜˜V B C˜[˜MÐ*Ð*r)   )r   zPath | Noner   ÚintÚreturnÚNone)r'   Ústrr2   zlogging.Logger)r/   z
str | Noner2   r4   )Ú__doc__Ú
__future__r   r   r   Úlogging.handlersr   Úpathlibr   r   r   ÚINFOr%   r(   r0   © r)   r$   ú<module>r;      s?   ðñõ #ã Û 
Ý 0Ý à@€Ø€ð +/¸W¿\¹\ô ó<2ô
+r)   