Skip to content
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

Logging: log only once each unknown typ #211

Open
humitos opened this issue Jul 13, 2022 · 3 comments
Open

Logging: log only once each unknown typ #211

humitos opened this issue Jul 13, 2022 · 3 comments
Assignees
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@humitos
Copy link
Member

humitos commented Jul 13, 2022

We are logging a lot of lines similar like the following multiple times. One per time that we find a reference without a typ defined.

Using default style (tooltip) for unknown typ (ref). Define it in hoverxref_role_types.

It would be log only once each different typ to avoid populating too much the output.

@humitos humitos added Improvement Minor improvement to code Accepted Accepted issue on our roadmap labels Jul 13, 2022
@humitos humitos self-assigned this Jul 13, 2022
@abravalheri
Copy link

abravalheri commented Aug 3, 2022

Hi @humitos is there a way of disabling this logging entirely?

I just noticed when building setuptools docs. I am OK with using the defaults and the logs end up in a very convoluted output for sphinx...

@humitos
Copy link
Member Author

humitos commented Aug 4, 2022

Unfortunately, there is no way to disable logging currently, as far as I know.

I found this message bothering myself as well, but I'm not sure what's the best way to communicate this to users. That's why I kept it and opened this issue to, at least, reduce the amount of lines logged.

Would it be enough for you to reduce the log as this issue propose, or you would prefer to remove the log completely and update the documentation saying if the typ is not defined the default will be used?

@abravalheri
Copy link

abravalheri commented Aug 4, 2022

Unfortunately, there is no way to disable logging currently, as far as I know.

Yeah, I tried to add the following statement to docs/conf.py without success:

logging.getLogger("hoverxref").setLevel(logging.WARNING)

I don't know how sphinx work internally, but could it be the case it is using different processes? (Or maybe I am making a wrong assumption about how the logging module works).

Would it be enough for you to reduce the log as this issue propose

That would definitely be a big help.

But since it does not seem to be easy to select a logging level in sphinx, does it make sense to add logging entries that do not correspond to a real warning/error that the user should be concerned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

2 participants