We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21e132c commit 3b6163fCopy full SHA for 3b6163f
1 file changed
examples/logging_utils.hpp
@@ -3,14 +3,15 @@
3
#include <format>
4
#include <iostream>
5
#include <string_view>
6
+#include <syncstream>
7
#include <thread>
8
-static inline std::ostream& log() {
9
- return std::cout << std::this_thread::get_id() << " ";
+static inline auto log() {
10
+ return std::osyncstream(std::cout) << std::this_thread::get_id() << " ";
11
}
12
-static inline std::ostream& log(std::string_view self) {
13
- return std::cout << std::this_thread::get_id() << " " << self << " ";
+static inline auto log(std::string_view self) {
14
+ return log() << self << " ";
15
16
17
static inline std::string format_name(std::string_view parent,
0 commit comments