void VLog(Verbosity verb, charconst* file, int line, std::optional<int> instance, charconst* format, fmt::format_args args) { // Generate the time label. auto now = std::chrono::system_clock::now(); auto now_ms = std::chrono::time_point_cast<std::chrono::milliseconds>(now); auto now_t = std::chrono::system_clock::to_time_t(now); char time_str[19]; // "mm-dd_HH:MM:SS.mmm\0" is 19 byte long auto n = std::strftime(time_str, sizeof(time_str), "%m-%d %H:%M:%S", std::localtime(&now_t));
snprintf(time_str + n, sizeof(time_str) - n, ".%03u", static_cast<unsignedint>(now_ms.time_since_epoch().count() % 1000));
// Use a memory buffer to format the message to avoid fmt::print assertions on redirected stdout.
fmt::memory_buffer buffer; auto out = std::back_inserter(buffer);
fmt::format_to(out, "root-canal {} {} {:<35} ", verbosity_tag[verb], time_str, file_str);
// Format the actual message if (enable_log_color) {
fmt::text_style style = text_style[verb];
fmt::vformat_to(out, style, format, args);
} else {
fmt::vformat_to(out, format, args);
}
fmt::format_to(out, "\n");
// Write to stdout using fwrite
fwrite(buffer.data(), 1, buffer.size(), stdout);
fflush(stdout);
if (verb == Verbosity::kFatal) {
std::abort();
}
}
} // namespace rootcanal::log
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.