diff options
author | Ed Tanous <ed@tanous.net> | 2024-04-09 03:18:12 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-05-07 03:37:41 +0300 |
commit | 17c472452c9a3518aeac636d01b8e2f01c4fa21f (patch) | |
tree | 39dcf835f3ea7836290b7f77c15f48abae46caff /.clang-tidy | |
parent | 8b901d78af166fa3017d930cf121b1dad6edbe0b (diff) | |
download | bmcweb-17c472452c9a3518aeac636d01b8e2f01c4fa21f.tar.xz |
Move logging args
Args captured by logging functions should be captured by rvalue, and use
std::forward to get perfect forwarding. In addition, separate out the
various std::out lines.
While we're here, also try to optimize a little. We should ideally be
writing each log line to the output once, and ideally not use iostreams,
which induce a lot of overhead.
Similar to spdlog[1] (which at one point this codebase used), construct
the string, then call fwrite and fflush once, rather than calling
std::cout repeatedly.
Now that we don't have a dependency on iostreams anymore, we can remove
it from the places where it has snuck in.
Tested:
Logging still functions as before. Logs present.
[1] https://github.com/gabime/spdlog/blob/27cb4c76708608465c413f6d0e6b8d99a4d84302/include/spdlog/sinks/stdout_sinks-inl.h#L70C7-L70C13
Change-Id: I1dd4739e06eb506d68989a066d122109b71b92cd
Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to '.clang-tidy')
0 files changed, 0 insertions, 0 deletions