Format: application/x-python-code
⬇ Download File (2.5 KB)
   1  o
   2  
   3  D'hI	�@s�ddlmZddlZddlZddlZddlmZddlm	Z	ej
   4  r'ddlmZedd	d
   5  ��Z
   6  ddd�Ze�e
   7  �Ze�e�d��ddd�ZdS)�)�annotationsN)�
   8  LocalProxy�)�request)�App�return�t.TextIOcCstrtjdStjS)a�Find the most appropriate error stream for the application. If a request
   9      is active, log to ``wsgi.errors``, otherwise use ``sys.stderr``.
  10  
  11      If you configure your own :class:`logging.StreamHandler`, you may want to
  12      use this for the stream. If you are using file or dict configuration and
  13      can't import this directly, you can refer to it as
  14      ``ext://flask.logging.wsgi_errors_stream``.
  15      zwsgi.errors)r�environ�sys�stderr�rr�CC:\Users\shubh\Videos\agent\nova\Lib\site-packages\flask/logging.py�wsgi_errors_streams
  16  
  17  r�logger�logging.Logger�boolcsF|���|}|r!t�fdd�|jD��rdS|js	dS|j}|sdS)z�Check if there is a handler in the logging chain that will handle the
  18      given logger's :meth:`effective level <~logging.Logger.getEffectiveLevel>`.
  19      c3s�|]}|j�kVqdS)N��level)�.0�handlerrrr
  20  �	<genexpr>'s�z$has_level_handler.<locals>.<genexpr>TF)�getEffectiveLevel�any�handlers�	propagate�parent)r�currentrrr
  21  �has_level_handlers��	rz6[%(asctime)s] %(levelname)s in %(module)s: %(message)s�apprcCs:t�|j�}|jr|js|�tj�t|�s|�t	�|S)a�Get the Flask app's logger and configure it if needed.
  22  
  23      The logger name will be the same as
  24      :attr:`app.import_name <flask.Flask.name>`.
  25  
  26      When :attr:`~flask.Flask.debug` is enabled, set the logger level to
  27      :data:`logging.DEBUG` if it is not set.
  28  
  29      If there is no handler for the logger's effective level, add a
  30      :class:`~logging.StreamHandler` for
  31      :func:`~flask.logging.wsgi_errors_stream` with a basic format.
  32      )
  33  �logging�	getLogger�name�debugr�setLevel�DEBUGr�
  34  addHandler�default_handler)rrrrr
  35  �
  36  create_logger:s
  37  
  38  r')rr)rrrr)rrrr)�
  39  __future__rrr
  40  �typing�tZwerkzeug.localr�globalsr�
  41  TYPE_CHECKINGZ
  42  sansio.apprrr�
  43  StreamHandlerr&�setFormatter�	Formatterr'rrrr
  44  �<module>s 
  45  
  46  �