-
Notifications
You must be signed in to change notification settings - Fork 0
Rotating log message #10
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
Conversation
felixjulianheitmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I think this feature makes sense and I see no issues with the implementation, I think git-wise this is a little difficult. The v2.x-Attributes-cmake-fixes branch is the one we're trying to merge upstream.
It might make sense to create a "tessonics-main" branch which rebases the changes of v2.x-Attributes-cmake-fixes on top of the v2 main that we then use for us internally. We can then continue implementing on top of that. If at some point the attribute branch would actually get merged this would be solved with a simple rebase.
Additionally regarding the actual code, I feel it's more modular if you add a file_rotation_event_handler function that gets called on rotation instead of providing a log message for this case. Then this can be used for a lot of things and not only for this specific log message. Or the log message can contain the current timestamp of the rotation or anything like that.
|
v2.x-Attributes-cmake-fixes Is already the internally use branch I switched to an callback approach |
tests/test_file_logging.cpp
Outdated
| } | ||
|
|
||
| TEST_CASE("rotating_file_logger6", "[rotating_logger]") { | ||
| auto empty_callback = [](const spdlog::filename_t &) -> std::optional<spdlog::details::log_msg> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty_callback -> copy paste typo
Added the option to add a custom log msg to the beginning of each file for the rotating_file_sink
Could be used to add the version of the application in each of the log files..