Closed StarbotArc closed 2 weeks ago
Why is last_msg a pointer? Can't we use a std::string directly and use an empty string instead of null?
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.
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 Actually I think this would add an empty string to the log on each program startup, so ignore itif (this->last_msg.size() > 0)
condition, the initial empty string should work fine on the if (message == this->last_msg)
check
superceded by #1305
Basically, no more big file sizes from repetitive logs. This pull request exists for issue #1291.