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

Debug levels #123

Open
garak opened this issue Nov 8, 2024 · 2 comments
Open

Debug levels #123

garak opened this issue Nov 8, 2024 · 2 comments

Comments

@garak
Copy link

garak commented Nov 8, 2024

The docs state that the valid values for setDebug are 0,1,2,3 but the source code states that valid values are -1, 0, 1, and 2. Which one is correct?

It would be nice to add class constants for those values, anyway.

@gggeek
Copy link
Owner

gggeek commented Nov 8, 2024

I know it's a bit confusing, but I think that both code and docs are correct ;-)

The thing is: the Server understands values 0 to 3, while the Client (well, the Request actually, as the Client passes the debug level down to it) understands values -1 to 2.

The reason for this discrepancy is the same as always: organic growth over time and wanting to keep BC at all costs while introducing new features.

As for introducing constants: it might be a good idea. I don't know which names would make sense though. Names such as SILENT, VERBOSE, VERY_VERBOSE could be used, but they would only alleviate the issue with passing in unsupported values, they would not be a clear indicator to the developer of their intended usage / effects...

@gggeek
Copy link
Owner

gggeek commented Nov 8, 2024

ps: I might also update the docs with a phrase about the Client accepting different debug levels than the Server...

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

2 participants