1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
U
ß=®d    ã@sžddlmZddlZddlZddlZddlmZddlm    Z    ej
rNddl m Z eddœd    d
„ƒZ d d d œdd„Ze e ¡Ze e d¡¡dd dœdd„ZdS)é)Ú annotationsN)Ú
LocalProxyé)Úrequest)ÚFlaskzt.TextIO)ÚreturncCstrtjdStjS)a•Find 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)rÚenvironÚsysÚstderr©r r úDd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\flask/logging.pyÚwsgi_errors_streams
r zlogging.LoggerÚbool)Úloggerrcs@| ¡‰|}|r<t‡fdd„|jDƒƒr,dS|js4q<|j}q dS)zšCheck if there is a handler in the logging chain that will handle the
    given logger's :meth:`effective level <~logging.Logger.getEffectiveLevel>`.
    c3s|]}|jˆkVqdS)N©Úlevel)Ú.0Úhandlerrr r Ú    <genexpr>$sz$has_level_handler.<locals>.<genexpr>TF)ÚgetEffectiveLevelÚanyÚhandlersÚ    propagateÚparent)rÚcurrentr rr Úhas_level_handlersrz6[%(asctime)s] %(levelname)s in %(module)s: %(message)sr)ÚapprcCs:t |j¡}|jr$|js$| tj¡t|ƒs6| t    ¡|S)a¸Get the Flask app's logger and configure it if needed.
 
    The logger name will be the same as
    :attr:`app.import_name <flask.Flask.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Ú    getLoggerÚnameÚdebugrÚsetLevelÚDEBUGrÚ
addHandlerÚdefault_handler)rrr r r Ú create_logger7s   
r%)Ú
__future__rrr    ÚtypingÚtZwerkzeug.localrÚglobalsrÚ TYPE_CHECKINGrrr rÚ StreamHandlerr$Ú setFormatterÚ    Formatterr%r r r r Ú<module>s     
ÿ