[Python] How to limit the length of or suppress local variables in structlog exception reports?

Discussão em 'Python' iniciado por Stack, Maio 15, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using structlog in an application. When I use it to render an exception:

    logger = structlog.get_logger()
    logger.exception("boom")


    I get the expected pretty exception report. However there are some local variables in that context which are very large. They make the exception report thousands of lines long. Not useful.

    Is there a way to either prevent specific variables from being rendered, or limiting the length of the output?

    Continue reading...

Compartilhe esta Página