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

Runtime debug log (getenv way ) #547

Closed
wants to merge 5 commits into from

Conversation

EgorWeders
Copy link
Contributor

@EgorWeders EgorWeders commented Aug 12, 2024

Added getenv() call in debug macro.
Checks only existence of variable.
Start with admin to use.
Add set DEBUG_GDPI=

@EgorWeders EgorWeders mentioned this pull request Aug 12, 2024
@EgorWeders
Copy link
Contributor Author

Can cause some performance decrease due to the getenv call. Not much, but testing on huge loads is necessary.

@ValdikSS
Copy link
Owner

No-no, that isn't great.

Please make a pointer to a debug print function, and a macros which checks whether the pointer is NULL and calls the function.
The arguments parser then sets the function pointer to a debug print function if this option is enabled (or if environment variable is set, etc).

@ValdikSS
Copy link
Owner

Do we really need environment variable? This seems less convenient, given that none other options are set with envs.

@EgorWeders
Copy link
Contributor Author

EgorWeders commented Aug 14, 2024

Do we really need environment variable? This seems less convenient, given that none other options are set with envs.

I know, this is one of the options that I was able to test quickly. It's more complicated with the cmd argument, since it needs to be passed on, and I don't really want to create a global variable for this (even as func pointer). I'll look at other ways. It would be better to cancel the pull request then.

@EgorWeders EgorWeders closed this Aug 14, 2024
@EgorWeders EgorWeders deleted the Runtime-debug-log branch August 21, 2024 02:05
@EgorWeders EgorWeders restored the Runtime-debug-log branch September 18, 2024 03:06
@EgorWeders EgorWeders mentioned this pull request Sep 18, 2024
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

Successfully merging this pull request may close these issues.

2 participants