Skip to content
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

Consolidate consecutive duplicate logger lines #1304

Closed
wants to merge 5 commits into from

Conversation

StarbotArc
Copy link

Basically, no more big file sizes from repetitive logs. This pull request exists for issue #1291.

@nico-abram
Copy link
Member

Why is last_msg a pointer? Can't we use a std::string directly and use an empty string instead of null?

@StarbotArc
Copy link
Author

Sorry, I don't have crazy on-hand experience with C++, I actually write more C code, so I resorted more to pointers instead. If you think that's a better idea, I would say go for it.

@nico-abram
Copy link
Member

nico-abram commented Apr 15, 2024

LGTM

Only nits like I mentioned on discord are

(1) maybe we can unlock the mutex before the call to plog by making a string copy
(2) I think we can remove the if (this->last_msg.size() > 0) condition, the initial empty string should work fine on the if (message == this->last_msg) check Actually I think this would add an empty string to the log on each program startup, so ignore it

src/Core/Misc/PlogLogger.cpp Outdated Show resolved Hide resolved
@poco0317 poco0317 changed the title Logger update. Consolidate consecutive duplicate logger lines Apr 18, 2024
@poco0317
Copy link
Member

superceded by #1305

@poco0317 poco0317 closed this Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants