Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/openstack/__pycache__/_log.cpython-39.pyc
Ðазад
a t�h[ � @ s( d dl Z d dlZddd�Zd dd�ZdS ) � Nc C s\ |pg }t �| �}t|j�dkr6|s6t �� }|�|� |D ]}|�|� q:|rX|�|� |S )a� Set up logging for a named logger. Gets and initializes a named logger, ensuring it at least has a `logging.NullHandler` attached. :param str name: Name of the logger. :param list handlers: A list of `logging.Handler` objects to attach to the logger. :param int level: Log level to set the logger at. :returns: A `logging.Logger` object that can be used to emit log messages. r )�logging� getLogger�len�handlers�NullHandler� addHandler�setLevel)�namer �level�log�h� r �~/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/openstack/_log.py� setup_logging s r F�/%(asctime)s %(levelname)s: %(name)s %(message)sc C s |s|st j}|rd} | r"tj}ntj}t�|�}|rL|D ]} | �|� q:nTg }|durzt�|�} |rp| �|� |�| � |dur�t� |�}|�|� |�|� t d||d� t d||d� t dt�� gtjd� t dt�� gtjd� t d� t d � t d � dS )a� Enable logging output. Helper function to enable logging. This function is available for debugging purposes and for folks doing simple applications who want an easy 'just make it work for me'. For more complex applications or for those who want more flexibility, the standard library ``logging`` package will receive these messages in any handlers you create. :param bool debug: Set this to ``True`` to receive debug messages. :param bool http_debug: Set this to ``True`` to receive debug messages including HTTP requests and responses. This implies ``debug=True``. :param str path: If a *path* is specified, logging output will written to that file in addition to sys.stderr. The path is passed to logging.FileHandler, which will append messages the file (and create it if needed). :param stream: One of ``None `` or ``sys.stdout`` or ``sys.stderr``. If it is ``None``, nothing is logged to a stream. If it isn't ``None``, console output is logged to this stream. :param bool format_stream: If format_stream is False, the default, apply ``format_template`` to ``path`` but not to ``stream`` outputs. If True, apply ``format_template`` to ``stream`` outputs as well. :param str format_template: Template to pass to :class:`logging.Formatter`. :rtype: None TNZ openstack)r r Zkeystoneauth�urllib3Z stevedorezkeystoneauth.discoveryzkeystoneauth.identity.basez"keystoneauth.identity.generic.base)�sys�stdoutr �DEBUG�INFO� Formatter�setFormatter� StreamHandler�append�FileHandlerr r )�debugZ http_debug�path�streamZ format_streamZformat_templater r � formatter�handler�console�file_handlerr r r �enable_logging. s@ % ��r"