-
Notifications
You must be signed in to change notification settings - Fork 45
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
Display all Fledge logs in stdout during unit tests #1207
Comments
FlorentP42
pushed a commit
to FlorentP42/fledge
that referenced
this issue
Oct 20, 2023
…gs in unit tests output.
FlorentP42
pushed a commit
to FlorentP42/fledge
that referenced
this issue
Oct 20, 2023
…gs in unit tests output. Signed-off-by: Florent Peyrusse <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Right now the Logger class only logs into specific Fledge output files and not into the standard output, meaning they will not appear when running unit tests.
Having a compile time flag to make all Fledge logs appear in stdout while running unit tests would be quite useful in plugin debugging phase.
Describe the solution you'd like
A solution would be to provide log function wrappers that would call both the Logger and the printf() function when a compile time flag is on so that the log is visible in both places.
Example of wrapper function for one log level:
Example of precompiler definition to add to the tests CMakeLists:
Example of usage:
LogUtils::log_debug("Logging some debug data: %s", data.c_str());
Describe alternatives you've considered
A more advanced approach would be to further upgrade the Logger class into handling multiple types of appenders so that the user could define its own appenders when configuring Fledge (see examples of implementation in https://log4cpp.sourceforge.net/).
This was not retained so far as it would have more impact on existing code and may result in interface evolutions.
Additional context
N/A
The text was updated successfully, but these errors were encountered: