mirror of
https://github.com/open-goal/jak-project
synced 2026-09-07 11:36:26 -04:00
logs: replace every fmt::print with a lg call instead (#1368)
Favors the `lg` namespace over `fmt` directly, as this will output the logs to a file / has log levels. I also made assertion errors go to a file, this unfortunately means importing `lg` and hence `fmt` which was attempted to be avoided before. But I'm not sure how else to do this aspect without re-inventing the file logging. We have a lot of commented out prints as well that we should probably cleanup at some point / switch them to trace level and default to `info` level. I noticed the pattern of disabling debug logs behind some boolean, something to consider cleaning up in the future -- if our logs were more structured (knowing where they are coming from) then a lot this boilerplate could be eliminated. Closes #1358
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "common/log/log.h"
|
||||
#include "common/util/FileUtil.h"
|
||||
#include "common/util/json_util.h"
|
||||
|
||||
@@ -29,7 +30,7 @@ Config read_config_file(const fs::path& path_to_config_file, const std::string&
|
||||
Config config;
|
||||
auto config_str = file_util::read_text_file(path_to_config_file);
|
||||
auto cfg = parse_commented_json(config_str, path_to_config_file.string());
|
||||
fmt::print("Config Overide: '{}'\n", override_json);
|
||||
lg::info("Config Overide: '{}'\n", override_json);
|
||||
auto cfg_override = parse_commented_json(override_json, "");
|
||||
cfg.update(cfg_override);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user