Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions examples/logging_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
#include <format>
#include <iostream>
#include <string_view>
#include <syncstream>
#include <thread>

static inline std::ostream& log() {
return std::cout << std::this_thread::get_id() << " ";
static inline auto log() {
return std::osyncstream(std::cout) << std::this_thread::get_id() << " ";
}

static inline std::ostream& log(std::string_view self) {
return std::cout << std::this_thread::get_id() << " " << self << " ";
static inline auto log(std::string_view self) {
return log() << self << " ";
}

static inline std::string format_name(std::string_view parent,
Expand Down