summaryrefslogtreecommitdiff
path: root/include/ossl_random.hpp
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2024-04-09 03:18:12 +0300
committerEd Tanous <ed@tanous.net>2024-05-07 03:37:41 +0300
commit17c472452c9a3518aeac636d01b8e2f01c4fa21f (patch)
tree39dcf835f3ea7836290b7f77c15f48abae46caff /include/ossl_random.hpp
parent8b901d78af166fa3017d930cf121b1dad6edbe0b (diff)
downloadbmcweb-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 'include/ossl_random.hpp')
-rw-r--r--include/ossl_random.hpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/include/ossl_random.hpp b/include/ossl_random.hpp
index 0e28944d83..4d4bc04a06 100644
--- a/include/ossl_random.hpp
+++ b/include/ossl_random.hpp
@@ -7,7 +7,6 @@ extern "C"
#include <openssl/rand.h>
}
-#include <iostream>
#include <limits>
#include <string>