σ ,E`c@@s­dZddlmZddlZddlZddlZddlmZddlm Z ed„ƒZ d„Z ej e ƒZ e jejd ƒƒd „Zd „ZdS( sN flask.logging ~~~~~~~~~~~~~ :copyright: 2010 Pallets :license: BSD-3-Clause i(tabsolute_importN(t LocalProxyi(trequestcC@strtjdStjS(s•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``. s wsgi.errors(Rtenvirontsyststderr(((s3/home/users/00/3b/ff/home/www/main/flask/logging.pytwsgi_errors_streams c@s\|jƒ‰|}xC|rWt‡fd†|jDƒƒr>tS|jsKPn|j}qWtS(sšCheck if there is a handler in the logging chain that will handle the given logger's :meth:`effective level <~logging.Logger.getEffectiveLevel>`. c3@s|]}|jˆkVqdS(N(tlevel(t.0thandler(R(s3/home/users/00/3b/ff/home/www/main/flask/logging.pys )s(tgetEffectiveLeveltanythandlerstTruet propagatetparenttFalse(tloggertcurrent((Rs3/home/users/00/3b/ff/home/www/main/flask/logging.pythas_level_handler!s    s6[%(asctime)s] %(levelname)s in %(module)s: %(message)scC@s,|jtjkp+|jp+|jp+|j S(sͺDecide if a logger has direct configuration applied by checking its properties against the defaults. :param logger: The :class:`~logging.Logger` to inspect. (RtloggingtNOTSETR tfiltersR(R((s3/home/users/00/3b/ff/home/www/main/flask/logging.pyt _has_config<s  cC@s·tj|jƒ}x\dD]T}tj|ƒ}t|ƒrt|ƒ rtjdjd|jd|ƒƒPqqW|jr—|j r—|j tj ƒnt |ƒs³|j t ƒn|S(s½Get 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. s flask.apptflasksΈ'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}'.tnametold_name(s flask.appsflask(Rt getLoggerRRtwarningstwarntformattdebugRtsetLeveltDEBUGRt addHandlertdefault_handler(tappRRt old_logger((s3/home/users/00/3b/ff/home/www/main/flask/logging.pyt create_loggerJs    (t__doc__t __future__RRRRtwerkzeug.localRtglobalsRRRt StreamHandlerR#t setFormattert FormatterRR&(((s3/home/users/00/3b/ff/home/www/main/flask/logging.pyts