Skip to content

Filter out warnings #3046

Answered by avaris
ndeville asked this question in Q&A
Sep 28, 2022 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Unfortunately, that's not the template string. It is built dynamically (here) which makes it annoyingly unhelpful for this kind of filtering. Code should probably be adjusted to have a static template, so I would consider this a bug. For now, you can try adding multiple versions of this template

import logging
LOG_FILTER = [
    (logging.WARN, 'There are %s items "%s" with lang %s: \n%s\n%s'),  # 2 item warning
    (logging.WARN, 'There are %s items "%s" with lang %s: \n%s\n%s\n%s'),  # 3 item warning
    (logging.WARN, 'There are %s items "%s" with lang %s: \n%s\n%s\n%s\n%s'),  # 4 item warning
    # ... so on. depending on your site and the kind of warnings you get
]

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ndeville
Comment options

@avaris
Comment options

@ndeville
Comment options

@bfueldner
Comment options

Answer selected by ndeville
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants