logger.h: Use utils::catv()

Who knows, clever people are everywhere
这个提交包含在:
2025-11-03 20:00:24 +01:00
父节点 ffa59d4b36
当前提交 e90b08dbde

查看文件

@@ -2,6 +2,7 @@
#define LOGGER_H #define LOGGER_H
#include <iostream> #include <iostream>
#include <chrono> #include <chrono>
#include "utils.h"
class Logger class Logger
{ {
private: private:
@@ -24,7 +25,15 @@ class Logger
{ {
(*out) << time(0) << " " << prefix; (*out) << time(0) << " " << prefix;
} }
if constexpr (std::is_convertible_v<T, std::string_view>)
{
(*out) << utils::catv(val);
}
else
{
(*out) << val; (*out) << val;
}
headerSent = true; headerSent = true;
return *this; // or maybe out itself? probably not. return *this; // or maybe out itself? probably not.
} }