Skip to content

Commit 092146c

Browse files
committed
fix: fix default config
1 parent 3f43a2a commit 092146c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/pl/Config.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ char const* pl_mods_path = "./plugins/"; // TODO: change to mods
1919
nlohmann::json config;
2020

2121
void loadConfig() try {
22-
auto configPath = std::filesystem::path{u8"PreLoaderConfig.json"};
22+
auto configPath = std::filesystem::path{u8"./PreLoaderConfig.json"};
2323

2424
try {
2525
if (std::filesystem::exists("./mods/")) { pl_mods_path = "./mods/"; } // TODO: remove when release
@@ -36,7 +36,7 @@ void loadConfig() try {
3636
} catch (...) {}
3737
config.clear();
3838
config["version"] = 1;
39-
config["colorLog"] = pl_color_log;
39+
config["colorLog"] = (bool)pl_color_log;
4040
config["logLevel"] = pl_log_level;
4141
config["logPath"] = pl_log_path;
4242
config["modsPath"] = pl_mods_path;

src/pl/internal/Logger.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#include "pl/internal/StringUtils.h"
1717
#include "pl/internal/WindowsUtils.h"
1818

19-
namespace fs = std::filesystem;
20-
2119
#define COLOR_TIME fmt::color::light_blue
2220
#define COLOR_INFO_PREFIX fmt::color::light_sea_green
2321
#define COLOR_INFO_TEXT fmt::terminal_color::white
@@ -33,8 +31,11 @@ namespace fs = std::filesystem;
3331

3432
#define LOG_PREFIX(prefix, color1, color2) \
3533
auto [time, ms] = ::pl::utils::getLocalTime(); \
36-
fmt::print(pl::pl_color_log ? fmt::fg(color1) : fmt::text_style(), fmt::format("{:%H:%M:%S}.{:0>3}", time, ms)); \
37-
fmt::print(pl::pl_color_log ? fmt::fg(color2) : fmt::text_style(), prefix);
34+
fmt::print( \
35+
static_cast<bool>(pl::pl_color_log) ? fmt::fg(color1) : fmt::text_style(), \
36+
fmt::format("{:%H:%M:%S}.{:0>3}", time, ms) \
37+
); \
38+
fmt::print(static_cast<bool>(pl::pl_color_log) ? fmt::fg(color2) : fmt::text_style(), prefix);
3839

3940
#define LOG(color1, color2, prefix) \
4041
LOG_PREFIX(prefix, color1, color2); \

0 commit comments

Comments
 (0)