| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
I’ve not following the details here, but if this is only about suppressing expected warnings in the doc builds, a warnings filter in conf.py would be the way to go. |
Sorry, something went wrong.
Not sure how since we want one warning per missing font to print out at once. I tried using the once filter and couldn't get that working. |
Sorry, something went wrong.
|
Ah sorry, I was thining about warnings.warn() not logging.warning(). Forget the filter comment then. I would base deduplication on the message. Separate ids is more effort than it's worth. Likely the simplest approach is to wrap your logging in use a functools.cache. |
Sorry, something went wrong.
Going down that rabbit hole, it looks like the least extra/most generalizable may be to make a custom loghandler or use a handler filter (which is what I'm trying now) |
Sorry, something went wrong.
|
So uh adding a filter works really nicely, and I can move it to the sphinxextensions - there's one for missing references I used as a model-but I think the multiple prints are annoying in any context. Only problem is it works a bit too well and I can't get the messages to show up on new runs -> any tips for resetting the msg_cache on new runs? |
Sorry, something went wrong.
| _log = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class findfontFilter(logging.Filter): |
There was a problem hiding this comment.
I would consider making this a private class, as this is internal functionality added to an already private logger.
(This is what stubtest is complaining about, as it sees this as public but not added to the stub files)
Sorry, something went wrong.
There was a problem hiding this comment.
Agree, made those changes locally but didn't push cause I'm still struggling w/ clearing the msg_cache
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Wrapping the log calls in a check that the missing font isn't in a list of missing fonts. Goal is to make the doc builds easier to read by squashing the extra prints.
I have it separated out my msg cause I'm not sure if that's important, could totally see easier versions that check if the entire msg has been seen (so stores a list of msgs) or that only looks at font and not the msg. base on call convo w/ @ksunden