test: log timestamps in test logger

This commit is contained in:
Marcus Holland-Moritz 2025-08-18 16:40:02 +02:00
parent 790d70c628
commit 7f587a1b6d

View File

@ -66,9 +66,10 @@ class test_logger : public ::dwarfs::logger {
void write(level_type level, std::string_view output,
source_location loc) override {
if (output_ && level <= output_threshold_) {
auto const t = get_current_time_string();
std::lock_guard lock(mx_);
std::cerr << level_char(level) << " [" << loc.file_name() << ":"
<< loc.line() << "] " << output << "\n";
std::cerr << level_char(level) << ' ' << t << " [" << loc.file_name()
<< ":" << loc.line() << "] " << output << "\n";
}
if (level <= threshold_) {