Summary of improvement TODOs from PR https://github.com/ElektraInitiative/libelektra/pull/2435
ELEKTRA_ADD_SOLUTION which can serve as new method of supplying a solution (https://github.com/ElektraInitiative/libelektra/pull/2435#discussion_r269769574)kdberrors.h to not strcmp for the full code but for the first digits and then for the full string. This reduces the strcmp calls significantly if there are lots of error codes. This performance optimization though should be more relevant if we have much more error codes (currently only 8) (Idea from @kodebach )ELEKTRA_ERROR_RESOURCE(...) instead of ELEKTRA_ERROR(RESOURCE,...). (https://github.com/ElektraInitiative/libelektra/pull/2589#discussion_r273174729)INFO level (https://github.com/ElektraInitiative/libelektra/issues/2610)Thank you for starting collecting the issues!
Please collect all problems/open discussions, even if you maybe will not solve them. E.g. "errno should be handled by error framework".
In #2435 we never talked about errno handling, I think it was another discussion which I do not remember unfortunately.
After going through the discussion I found another task but I think thats it. Do you remember anything else?
I also did not remember "errno", I found it by skimming the discussion. I expected that you will look through everything properly, so that nothing gets lost.
Very good that you finally improve our error system!
I just saw #373. It is a very old problem and still unfixed.
So #373 is basically a macro generation where the error type is integrated into the name if I have understand that correctly?
macro in the specification. Unfortunately, we never completely finished it, so we still have error codes/macros intermixed.As discussed in #2610 it would also make sense to have info messages which are not shown by default at all.
This is basically abusing the error message concept to also use for logging. I have never seen anything like that in a project before. There should be another concept or way of logging and saving cache hit messages. I can add it here as idea but it would really be against my intuition to incorporate it into the error concept
373 suggested that we introduce something like
macroin the specification. Unfortunately, we never completely finished it, so we still have error codes/macros intermixed.
At the moment we do not have them mixed anymore with the new concept. But I am still unsure what you actually want with #373. A macro entry which is mandatory?
This is basically abusing the error message concept to also use for logging
I agree with both of you. There is no good concept for info messages in Elektra, but integrating them into the error concept is also not a good solution. The problem IMO is that logging in Elektra is disabled by default and even if Elektra is compiled with -DENABLE_LOGGER=ON, the logging is filtered very heavily (only message from files below src/tools are shown), unless you maintain a separate version of log.c.
IMO we should enable logging to syslog (I think we are missing openlog and closelog) by default for message of level INFO and above, no matter were the originate from.
I agree, but it would be handy to be able to set the log level by configuration (without recompiling).
Edit: I also think that INFO is too verbose as a default setting.
Yes, let us discuss this tomorrow.
I think we can easily make the logger more verbose on default. It is disabled by default anyway. And if someone passes -DENABLE_LOGGER=ON he/she obviously wants logs.
But this is actually another problem. The info messages I suggested above are messages that should go to the end user (like warnings+error) and not to the loggers.
I added two points:
The guideline should be done asap as there already seem to be inconsistent categorizations.
I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions :sparkling_heart:
I closed this issue now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue.
Thank you for your contributions :sparkling_heart: