OXIESEC PANEL
- Current Dir:
/
/
usr
/
local
/
lib
/
python3.6
/
dist-packages
/
flask
Server IP: 10.0.0.4
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/19/2021 04:38:27 PM
rwxrwxr-x
📄
__init__.py
2.2 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
__main__.py
30 bytes
09/19/2021 04:38:24 PM
rw-r--r--
📁
__pycache__
-
09/19/2021 04:38:27 PM
rwxr-xr-x
📄
app.py
80.45 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
blueprints.py
22.99 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
cli.py
31.29 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
config.py
10.81 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
ctx.py
17.02 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
debughelpers.py
6.03 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
globals.py
1.68 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
helpers.py
29.87 KB
09/19/2021 04:38:24 PM
rw-r--r--
📁
json
-
09/19/2021 04:38:27 PM
rwxr-xr-x
📄
logging.py
2.22 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
py.typed
0 bytes
09/19/2021 04:38:24 PM
rw-r--r--
📄
scaffold.py
31.64 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
sessions.py
14.83 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
signals.py
2.08 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
templating.py
5.49 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
testing.py
10.04 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
typing.py
1.64 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
views.py
5.73 KB
09/19/2021 04:38:24 PM
rw-r--r--
📄
wrappers.py
5.47 KB
09/19/2021 04:38:24 PM
rw-r--r--
Editing: logging.py
Close
import logging import sys import typing as t from werkzeug.local import LocalProxy from .globals import request if t.TYPE_CHECKING: from .app import Flask @LocalProxy def wsgi_errors_stream() -> t.TextIO: """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``. """ return request.environ["wsgi.errors"] if request else sys.stderr def has_level_handler(logger: logging.Logger) -> bool: """Check if there is a handler in the logging chain that will handle the given logger's :meth:`effective level <~logging.Logger.getEffectiveLevel>`. """ level = logger.getEffectiveLevel() current = logger while current: if any(handler.level <= level for handler in current.handlers): return True if not current.propagate: break current = current.parent # type: ignore return False #: Log messages to :func:`~flask.logging.wsgi_errors_stream` with the format #: ``[%(asctime)s] %(levelname)s in %(module)s: %(message)s``. default_handler = logging.StreamHandler(wsgi_errors_stream) # type: ignore default_handler.setFormatter( logging.Formatter("[%(asctime)s] %(levelname)s in %(module)s: %(message)s") ) def create_logger(app: "Flask") -> logging.Logger: """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. """ logger = logging.getLogger(app.name) if app.debug and not logger.level: logger.setLevel(logging.DEBUG) if not has_level_handler(logger): logger.addHandler(default_handler) return logger