U )._ @sdZddlmZddlZddlZddlZddlmZddlm Z eddZ d d Z e e Z e ed d d ZddZdS)zN flask.logging ~~~~~~~~~~~~~ :copyright: 2010 Pallets :license: BSD-3-Clause )absolute_importN) LocalProxy)requestcCstrtjdStjS)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)renvironsysstderrr r C:\Users\Miouzora\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\flask/logging.pywsgi_errors_streams r cs@||}|r`. c3s|]}|jkVqdS)Nlevel).0handlerr r r )sz$has_level_handler..TF)getEffectiveLevelanyhandlers propagateparent)loggercurrentr r r has_level_handler!srz6[%(asctime)s] %(levelname)s in %(module)s: %(message)scCs |jtjkp|jp|jp|j S)zDecide if a logger has direct configuration applied by checking its properties against the defaults. :param logger: The :class:`~logging.Logger` to inspect. )r loggingNOTSETrfiltersr)rr r r _has_config<s rcCsxt|j}dD]8}t|}t|rt|stdj|j|dqJq|jrb|jsb| tj t |st| t |S)aGet the the Flask apps'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. )z flask.appZflaskz'app.logger' is named '{name}' for this application, but configuration was found for '{old_name}', which no longer has an effect. The logging configuration should be moved to '{name}'.)nameold_name)r getLoggerrrwarningswarnformatdebugr setLevelDEBUGr addHandlerdefault_handler)ZapprrZ old_loggerr r r create_loggerJs     r()__doc__ __future__rrrr Zwerkzeug.localrglobalsrr r StreamHandlerr' setFormatter Formatterrr(r r r r s