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

Use trace log level instead of debug #273

Open
merlinz01 opened this issue May 21, 2024 · 0 comments
Open

Use trace log level instead of debug #273

merlinz01 opened this issue May 21, 2024 · 0 comments

Comments

@merlinz01
Copy link

I added a Hypercorn server to my application for an API. I still want to be able to debug my own code, but if I enable the debug logging level, it results in lots of irrelevant (for me) debug-level encoding/decoding logs from hpack.hpack. IMHO, that sort of logs should be at a lower level yet than debug.

Here's my general philosophy of log levels:

Error: Something went wrong and needs to be fixed.
Warning: The user did something invalid. Or you shouldn't do thus-and-so for best results.
Info: Something routine and occasional happened (like a new connection). This is what to look for to see if things are running OK in production.
Debug: This is relevant details about how the program is flowing. Some lower-level task returned successfully, or a risky function is about to be called, or a frequent routine operation is in the works, or the user's ID is johndoe.
Trace: Lots of nitty-gritty details in case we can't nail that bug.

The logging module doesn't define a trace level but you can do it by simply stating TRACE = 5 and calling log.log(TRACE, ...).
I can open a PR to do this if you are OK with the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant