HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/_logging/__pycache__/mixins.cpython-310.pyc
o

�N�g�@s�dZddlZddlZddlZddlZe�e�ZGdd�d�Z	Gdd�d�Z
Gdd�d�ZGd	d
�d
e�Z
Gdd�d�ZGd
d�d�ZdS)zP
    salt._logging.mixins
    ~~~~~~~~~~~~~~~~~~~~

    Logging related mix-ins
�Nc@�eZdZdZdd�ZdS)�LoggingProfileMixin�H
    Simple mix-in class to add a trace method to python's logging.
    cO�&|jttdd�|g|�Ri|��dS)NZPROFILE���log�getattr�logging��self�msg�args�kwargs�r�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/_logging/mixins.py�profile�&zLoggingProfileMixin.profileN)�__name__�
__module__�__qualname__�__doc__rrrrrr�rc@r)�LoggingTraceMixinrcOr)NZTRACE�rrrrr�tracerzLoggingTraceMixin.traceN)rrrrrrrrrrrrc@r)�LoggingGarbageMixinzJ
    Simple mix-in class to add a garbage method to python's logging.
    cOr)NZGARBAGErrrrrr�garbage(rzLoggingGarbageMixin.garbageN)rrrrrrrrrr#rrc� eZdZdZ�fdd�Z�ZS)�LoggingMixinMetaa	
    This class is called whenever a new instance of ``SaltLoggingClass`` is
    created.

    What this class does is check if any of the bases have a `trace()` or a
    `garbage()` method defined, if they don't we add the respective mix-ins to
    the bases.
    cs�d}}}t|�}|dkr(|D]}t|d�rd}t|d�r d}t|d�r'd}q|r/|�t�|r6|�t�|r=|�t�t��||t|�|�S)NTZSaltLoggingClassrFrr)	�list�hasattr�appendrrr�super�__new__�tuple)Zmcs�name�basesZattrsZinclude_profileZ
include_traceZinclude_garbage�base��	__class__rrr$6s$


�


zLoggingMixinMeta.__new__)rrrrr$�
__classcell__rrr)rr,s	rcr)�ExcInfoOnLogLevelFormatMixinzj
    Logging handler class mixin to properly handle including exc_info on a per logging handler basis
    cs�t��|�}t|dd�}t|dd�}|dur|dur|S|j|kr#|S|js*|s*|S|jdur@|jdur8tj|_|j�	|j�|_|dd�dkrL|d7}z||j7}Wnt
yg||j�t�
�d�7}Ynwd|_|S)zn
        Format the log record to include exc_info if the handler is enabled for a specific log level
        �exc_info_on_loglevelN�exc_info_on_loglevel_formatted����
�replace)r#�formatr	�levelZexc_info_on_loglevel_instancer.�	formatterr
�_defaultFormatter�formatException�UnicodeError�decode�sys�getfilesystemencoding)r�recordZformatted_recordr-r.r)rrr2Os>�
��

�	
��z#ExcInfoOnLogLevelFormatMixin.format)rrrrr2r+rrr)rr,Jsr,c@seZdZdd�Zdd�ZdS)�MultiprocessingStateMixinc
Cst|d}tj��stj�|�ztj��Wnty/}z
t�d||�WYd}~nd}~wwt�	|tjj
�dS)N�logging_configz%Failed to configure logging on %s: %s)�salt�_logging�get_logging_options_dictZset_logging_options_dictZ
setup_logging�	Exceptionr�	exception�weakref�finalizeZshutdown_logging)r�stater=�excrrr�__setstate__�s
���z&MultiprocessingStateMixin.__setstate__cCsdtj��iS)Nr=)r>r?r@)rrrr�__getstate__�s
�z&MultiprocessingStateMixin.__getstate__N)rrrrGrHrrrrr<�sr<)rr
r9rCZ
salt._loggingr>�	getLoggerrrrrr�typerr,r<rrrr�<module>s
			C