GoodbyeDPI icon indicating copy to clipboard operation
GoodbyeDPI copied to clipboard

Runtime debug log (getenv way )

Open EgorWeders opened this issue 1 year ago • 1 comments

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

EgorWeders avatar Aug 12 '24 05:08 EgorWeders

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

EgorWeders avatar Aug 12 '24 05:08 EgorWeders

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 avatar Aug 13 '24 17:08 ValdikSS

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

ValdikSS avatar Aug 13 '24 18:08 ValdikSS

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 avatar Aug 14 '24 01:08 EgorWeders