Home / Function/ wsgi_errors_stream() — flask Function Reference

wsgi_errors_stream() — flask Function Reference

Architecture documentation for the wsgi_errors_stream() function in logging.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  5716ac47_05c8_440c_91a4_76fddef339b9["wsgi_errors_stream()"]
  3bd07725_f871_e2d4_476f_62e7d3f6e96a["logging.py"]
  5716ac47_05c8_440c_91a4_76fddef339b9 -->|defined in| 3bd07725_f871_e2d4_476f_62e7d3f6e96a
  5716ac47_05c8_440c_91a4_76fddef339b9["wsgi_errors_stream()"]
  5716ac47_05c8_440c_91a4_76fddef339b9 -->|calls| 5716ac47_05c8_440c_91a4_76fddef339b9
  5716ac47_05c8_440c_91a4_76fddef339b9["wsgi_errors_stream()"]
  5716ac47_05c8_440c_91a4_76fddef339b9 -->|calls| 5716ac47_05c8_440c_91a4_76fddef339b9
  style 5716ac47_05c8_440c_91a4_76fddef339b9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/logging.py lines 16–28

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``.
    """
    if request:
        return request.environ["wsgi.errors"]  # type: ignore[no-any-return]

    return sys.stderr

Subdomains

Frequently Asked Questions

What does wsgi_errors_stream() do?
wsgi_errors_stream() is a function in the flask codebase, defined in src/flask/logging.py.
Where is wsgi_errors_stream() defined?
wsgi_errors_stream() is defined in src/flask/logging.py at line 16.
What does wsgi_errors_stream() call?
wsgi_errors_stream() calls 1 function(s): wsgi_errors_stream.
What calls wsgi_errors_stream()?
wsgi_errors_stream() is called by 1 function(s): wsgi_errors_stream.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free