6V=jI ddlmZddlZddlZddlZddlmZddlm Z ej rddl m Z edd Z dd Zeje ZeejdddZdS)) annotationsN) LocalProxy)request)Appreturnt.TextIOcLtrtjdStjS)aFind the most appropriate error stream for the application. If a request is active, log to ``wsgi.errors``, otherwise use ``sys.stderr``. If you configure your own :class:`logging.StreamHandler`, you may want to use this for the stream. If you are using file or dict configuration and can't import this directly, you can refer to it as ``ext://flask.logging.wsgi_errors_stream``. z wsgi.errors)renvironsysstderr;C:\PYTHON\_runtimes\venv\Lib\site-packages\flask/logging.pywsgi_errors_streamrs!.}-- :rloggerlogging.Loggerboolc||}|r3tfd|jDrdS|jsn |j}|3dS)zCheck if there is a handler in the logging chain that will handle the given logger's :meth:`effective level <~logging.Logger.getEffectiveLevel>`. c3.K|]}|jkVdS)N)level).0handlerrs r z$has_level_handler..'s*FF'w}%FFFFFFrTF)getEffectiveLevelanyhandlers propagateparent)rcurrentrs @rhas_level_handlerr!sv  $ $ & &EG ! FFFFW5EFFF F F 4   . ! 5rz6[%(asctime)s] %(levelname)s in %(module)s: %(message)sapprctj|j}|jr&|js|tjt|s|t|S)aGet the Flask app's logger and configure it if needed. The logger name will be the same as :attr:`app.import_name `. When :attr:`~flask.Flask.debug` is enabled, set the logger level to :data:`logging.DEBUG` if it is not set. If there is no handler for the logger's effective level, add a :class:`~logging.StreamHandler` for :func:`~flask.logging.wsgi_errors_stream` with a basic format. ) logging getLoggernamedebugrsetLevelDEBUGr! addHandlerdefault_handler)r"rs r create_loggerr,:sf sx ( (F y'' &&& V $ $+/*** Mr)rr )rrrr)r"rrr) __future__rr$r typingtwerkzeug.localrglobalsr TYPE_CHECKING sansio.apprrr! StreamHandlerr+ setFormatter Formatterr,rrrr7s"""""" %%%%%%?       *(''(:;;GNOO r