#include <chrono>
#include <random>
#include <stdlib.h>
#include <thread>
#define SET_SIZE_LIMIT_
#ifndef SET_SIZE_LIMIT_
#else
constinit const std::array fallbacks{
"timelog/{:%y%m%d-%H}.log",
"timelog/{:%y%m%d-%H-%M}.log",
"timelog/{:%y%m%d-%H-%M-%S}.log"
};
#endif
thread_local std::mt19937 g_rng{std::random_device{"/dev/urandom"}()};
{LL_FATAL, "Hello fatal"},
{LL_ERROR, "Hello error"},
{LL_WARNING, "Hello warning"},
{LL_INFO, "Hello info"},
{LL_VERBOSE, "Hello verbose"},
};
int main(int argc, const char *argv[])
{
if (argc <= 1)
{
for (auto i: LOG_SRC)
}
else
{
using C_MyClock = std::chrono::system_clock;
const auto deadline = C_MyClock::now() + std::chrono::seconds(strtoul(argv[1],nullptr,0));
while (C_MyClock::now() < deadline)
{
const auto &i = LOG_SRC[std::uniform_int_distribution<size_t>{0,std::size(LOG_SRC)-1}(g_rng)];
std::this_thread::sleep_for(
#ifdef SET_SIZE_LIMIT_
std::chrono::milliseconds(100)
#else
std::chrono::seconds(1)
#endif
);
}
}
}
#define LOGGER_USE_LOCAL_TIME_
#define DEF_LOGGER_FILES(pathfmt,...)
#define DEF_FALLBACK_LOGGER_FILES(fsize_in_bytes, fallbackPaths)
#define LOG(ll, fmtStr,...)