logger.h: Use utils::catv()
Who knows, clever people are everywhere
此提交包含在:
9
logger.h
9
logger.h
@@ -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.
|
||||||
}
|
}
|
||||||
|
|||||||
新增問題並參考
封鎖使用者