-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Log about font manager generation beforehand. #16374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This should rarely ever happen, though, hence it was pushed up to info I think. Its also slow and users wanted to know why matplotlib was locking up. However, I agree the message could be clearer? |
(I don't really care about the log level, but yes, this should only happen once...) |
Is it that slow? I hadn't really noticed. Is the speed dependent on how many fronts you have installed? I suggested this change because it didn't seem all that useful to know in general. If users really needed to work out what was going on they could enable debug level logging. Also this message occurs after the slow bit based on how it is phrased? Surely beforehand saying "Generating new font manager, this may take some time..." would make more sense?
Sorry, it should be only once - I think that I added a separate handler for matplotlib to only log at info level due to the excess noise at debug level and forgot to stop propagation. |
By only "once" we mean it should only happen once ever, unless you clear your font cache. |
Ah, yes. So I see it a lot because I have multiple docker containers spawned in parallel and the cache is lost when containers are shut down, so it is always rather than once. I guess that it should be possible to change the cache path to put it on a volume and share/reuse it? That is also probably why it doesn't take (too) much time because there are limited fonts installed within the container. |
Can you just make |
It does depend on the number of fonts you have installed (at one point we were looking at the full OSX system font directory and people were reporting ~minutes of run time). The I suggest importing matplotlib as part of building the docker container ( |
Ok. So I see this really amounts to a configuration issue for me to address, although it wasn't obvious. I'll look into your suggestions, @tacaswell - Thanks. I've tweaked this patch to restore the info level logging, but moved the message ahead of the generation - after all, it makes sense to tell the user that something is about to happen that takes ~minutes, rather than saying "oh, by the way that big pause was because..." Thanks everyone. |
Thanks! |
PR Summary
Changes an info level log message to debug. This reduces noise on the root logger, e.g.
It's not very descriptive or helpful in general.
PR Checklist
Has Pytest style unit testsNew features are documented, with examples if plot relatedDocumentation is sphinx and numpydoc compliantAdded an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way