BYPASS SHELL BY ./RAZORGANZ
Server: nginx/1.20.1
System: Linux iZdzfnv9mwfppeZ 5.10.134-19.2.al8.x86_64 #1 SMP Wed Oct 29 22:47:09 CST 2025 x86_64
User: apache (48)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //lib64/python3.6/site-packages/tornado/__pycache__/log.cpython-36.opt-1.pyc
3

	��f<0�@sdZddlZddlZddlZddlmZddlmZmZyddl	Z	Wne
k
r\dZ	YnXyddlZWne
k
r�dZYnXddlm
Z
mZmZejd�Zejd�Zejd�Zed	�d
d�Zeed�d
d�ZGdd�dej�Zdeejdd�dd�Zdedd�dd�ZdS)aHLogging support for Tornado.

Tornado uses three logger streams:

* ``tornado.access``: Per-request logging for Tornado's HTTP servers (and
  potentially other servers in the future)
* ``tornado.application``: Logging of errors from application code (i.e.
  uncaught exceptions from callbacks)
* ``tornado.general``: General-purpose logging, including any errors
  or warnings from Tornado itself.

These streams may be configured independently using the standard library's
`logging` module.  For example, you may wish to send ``tornado.access`` logs
to a separate file for analysis.
�N)�_unicode)�unicode_type�basestring_type)�Dict�Any�castztornado.accessztornado.applicationztornado.general)�returncCsryXttjd�rVtjj�rVtr8tj�tjd�dkrVdSntrVtjttj	dt
��krVdSWntk
rlYnXdS)N�isatty�colorsrTZwrapped_stderrF)�hasattr�sys�stderrr	�cursesZ	setuptermZtigetnum�colorama�getattrZ
initialise�object�	Exception�rr�/usr/lib64/python3.6/log.py�_stderr_supports_color7sr)�srcCs&yt|�Stk
r t|�SXdS)N)r�UnicodeDecodeError�repr)rrrr�
_safe_unicodeJsrc@speZdZdZdZdZejdejdej	dej
diZeedd	efeeee
eeefd
d�dd
�Zeed�dd�Zd
S)�LogFormatterapLog formatter used in Tornado.

    Key features of this formatter are:

    * Color support when logging to a terminal that supports it.
    * Timestamps on every log line.
    * Robust against str/bytes encoding problems.

    This formatter is enabled automatically by
    `tornado.options.parse_command_line` or `tornado.options.parse_config_file`
    (unless ``--logging=none`` is used).

    Color support on Windows versions that do not support ANSI color codes is
    enabled by use of the colorama__ library. Applications that wish to use
    this must first initialize colorama with a call to ``colorama.init``.
    See the colorama documentation for details.

    __ https://pypi.python.org/pypi/colorama

    .. versionchanged:: 4.5
       Added support for ``colorama``. Changed the constructor
       signature to be compatible with `logging.config.dictConfig`.
    zV%(color)s[%(levelname)1.1s %(asctime)s %(module)s:%(lineno)d]%(end_color)s %(message)sz%y%m%d %H:%M:%S�����%TN)�fmt�datefmt�style�colorr
rc	Cs�tjj||d�||_i|_|r�t�r�tdk	r�tjd�pDtjd�pDd}x,|j�D] \}}t	tj
||�d�|j|<qPWt	tjd�d�|_q�x"|j�D]\}}d||j|<q�Wd	|_nd
|_dS)aX
        :arg bool color: Enables color support.
        :arg str fmt: Log message format.
          It will be applied to the attributes dict of log records. The
          text between ``%(color)s`` and ``%(end_color)s`` will be colored
          depending on the level if color support is on.
        :arg dict colors: color mappings from logging level to terminal color
          code
        :arg str datefmt: Datetime format.
          Used for formatting ``(asctime)`` placeholder in ``prefix_fmt``.

        .. versionchanged:: 3.2

           Added ``fmt`` and ``datefmt`` arguments.
        )r!NZsetafZsetf��asciiZsgr0z[2;3%dmz�)�logging�	Formatter�__init__�_fmt�_colorsrrZtigetstr�itemsrZtparm�_normal)	�selfr r!r"r#r
Zfg_color�levelno�coderrrr)ss
zLogFormatter.__init__)�recordrcCs�y|j�}t|�|_Wn2tk
rH}zd||jf|_WYdd}~XnX|j|tt|j��|_	|j
|jkr�|j|j
|_|j
|_nd|_|_|j|j}|jr�|js�|j|j�|_|jr�|j�g}|jdd�|jjd�D��dj|�}|jdd�S)NzBad message (%r): %rr&css|]}t|�VqdS)N)r)�.0�lnrrr�	<genexpr>�sz&LogFormatter.format.<locals>.<genexpr>�
z
    )Z
getMessager�messager�__dict__Z
formatTimer�strr!Zasctimer/r+r#r-Z	end_colorr*�exc_infoZexc_textZformatException�rstrip�extend�split�join�replace)r.r1r6�eZ	formatted�linesrrr�format�s&"


zLogFormatter.format)�__name__�
__module__�__qualname__�__doc__ZDEFAULT_FORMATZDEFAULT_DATE_FORMATr'�DEBUG�INFOZWARNINGZERRORZDEFAULT_COLORSr8�boolr�intr)rrArrrrrQs
)r)�options�loggerrcCs|dkrddl}|jj}|jdks0|jj�dkr4dS|dkrDtj�}|jtt|jj���|jr�|j	}|dkr�tj
j|j|j|j
dd�}n<|dkr�tj
j|j|j|j|j
dd�}nd	d
|}t|��|jtdd��|j|�|js�|jdko�|j
�rtj�}|jt��|j|�dS)
z�Turns on formatted logging output as configured.

    This is called automatically by `tornado.options.parse_command_line`
    and `tornado.options.parse_config_file`.
    NrZnone�sizezutf-8)�filenameZmaxBytes�backupCount�encodingZtime)rMZwhenZintervalrNrOz.The value of log_rotate_mode option should be z"size" or "time", not "%s".F)r#)�tornado.optionsrJr'�lower�	getLoggerZsetLevelr�upper�log_file_prefix�log_rotate_modeZhandlersZRotatingFileHandler�log_file_max_size�log_file_num_backupsZTimedRotatingFileHandler�log_rotate_when�log_rotate_interval�
ValueErrorZsetFormatterrZ
addHandler�
log_to_stderrZ
StreamHandler)rJrK�tornadoZrotate_modeZchannelZ
error_messagerrr�enable_pretty_logging�s@



r])rJrcs��dkrddl}|jj��jddddd��jdtdd	d
��jdtddd
d��jdtd"dd
��jdtddd
��jdtddd
��jdtddd
��jdtddd
��j�fdd ��dS)#aBAdd logging-related flags to ``options``.

    These options are present automatically on the default options instance;
    this method is only necessary if you have created your own `.OptionParser`.

    .. versionadded:: 4.2
        This function existed in prior versions but was broken and undocumented until 4.2.
    Nrr'�infozSSet the Python log level. If 'none', tornado won't touch the logging configuration.zdebug|info|warning|error|none)�default�help�metavarr[z�Send log output to stderr (colorized if possible). By default use stderr if --log_file_prefix is not set and no other logging is configured.)�typer_r`rT�PATHz�Path prefix for log files. Note that if you are running multiple tornado processes, log_file_prefix must be different for each of them (e.g. include the port number))rbr_rar`rV�di�z%max size of log files before rolloverrW�
znumber of log files to keeprXZmidnightzcspecify the type of TimedRotatingFileHandler interval other options:('S', 'M', 'H', 'D', 'W0'-'W6')rYrz$The interval value of timed rotatingrUrLz(The mode of rotating files(time or size)cst��S)N)r]r)rJrr�<lambda>Psz(define_logging_options.<locals>.<lambda>i��i�)rPrJZdefinerHr8rIZadd_parse_callback)rJr\r)rJr�define_logging_optionssT	rg)NN)N)rEr'Zlogging.handlersrZtornado.escaperZtornado.utilrrr�ImportErrorrZtypingrrrrRZ
access_logZapp_logZgen_logrHrr8rr(rZLoggerr]rgrrrr�<module>s.




0