55 if (!std::filesystem::exists(
"." + applicationName))
56 std::filesystem::create_directory(
"." + applicationName);
57 if (!std::filesystem::exists(
"." + applicationName +
"/logs"))
58 std::filesystem::create_directory(
"." + applicationName +
"/logs");
62 logFile.open(
"." + applicationName +
"/logs/" + date::format(
"%F--%H-%M", std::chrono::system_clock::now()) +
".log");
64 auto timestamp = std::chrono::time_point_cast<std::chrono::seconds>(std::chrono::system_clock::now());
65 logFile.open(
"." + applicationName +
"/logs/" + std::format(
"{:%F--%H-%M}", std::chrono::zoned_time{std::chrono::current_zone(), timestamp}) +
".log");
69 HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
70 if (hOut == INVALID_HANDLE_VALUE) {
75 if (!GetConsoleMode(hOut, &dwMode)) {
79 dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
80 if (!SetConsoleMode(hOut, dwMode)) {
93 return date::format(
"%I:%M %p", date::make_zoned(date::current_zone(), std::chrono::system_clock::now()));
95 auto timestamp = std::chrono::time_point_cast<std::chrono::seconds>(std::chrono::system_clock::now());
96 return std::format(
"{:%I:%M %p}", std::chrono::zoned_time{std::chrono::current_zone(), timestamp});