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
C/C++ API #16
Comments
I use plogr for C++ logging, which has zero impact if turned off at compile time and low impact if turned off at run time. |
That's not bad. But I also want it to work the same way. I.e.
|
Want to spend a couple of hours in Brussels integrating these two packages? |
This would be handy for me now, but I need a solution that works in pure C code (as well). For |
plogr calls currently look like |
Yeah, |
And we would also need to embed the C lib into |
plogr is header-only, can we do the same with C? How about starting the C API in debugme, and then adapting the plogr API to use the debugme C API under the hood, or move the plogr API to debugme? |
I guess we could, but not if we use |
I'd suggest to independently start a C header-only implementation in debugme, with env var triggers and color, and then see how to include the rather nice C++ API, but maybe without the rest of plog. |
OTOH, it would be just easier to use sg like https://github.com/wonder-mice/zf_log |
Yeah, I'd suggest to use a header-only library, though. |
I am not sure if there is a header only C logging library. |
Maybe it's sufficient if the header contains everything necessary to decide if a log event happens, and then we use R callbacks to forward to debugme? |
I would avoid calling back to R if possible.... I think there is no other sensible way, but define a proper C API using |
That's what I meant ;-) Do you agree that the logic that decides if anything is logged needs to be in the header file? How do we make this fast, ideally one memory read and one conditional jump? |
Yes, sure, those must be macros. |
Would be nice.
The text was updated successfully, but these errors were encountered: