mirror of
https://github.com/open-goal/jak-project
synced 2026-07-10 23:22:17 -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,6 +1,7 @@
|
||||
#include "bitfields.h"
|
||||
|
||||
#include "common/goos/PrettyPrinter.h"
|
||||
#include "common/log/log.h"
|
||||
#include "common/util/BitUtils.h"
|
||||
#include "common/util/Range.h"
|
||||
|
||||
@@ -563,7 +564,7 @@ FormElement* BitfieldAccessElement::push_step(const BitfieldManip step,
|
||||
|
||||
// in this case, we expect the value we're oring with to be the appropriate mask for the field.
|
||||
|
||||
fmt::print("Rare bitfield set!\n");
|
||||
lg::info("Rare bitfield set!");
|
||||
u64 value = step.amount;
|
||||
auto type = ts.lookup_type(m_type);
|
||||
auto as_bitfield = dynamic_cast<BitFieldType*>(type);
|
||||
@@ -621,7 +622,7 @@ FormElement* BitfieldAccessElement::push_step(const BitfieldManip step,
|
||||
}
|
||||
lg::error("Current: {}", step.print());
|
||||
if (m_got_pcpyud) {
|
||||
lg::error("Got pcpyud\n");
|
||||
lg::error("Got pcpyud");
|
||||
}
|
||||
|
||||
throw std::runtime_error("Unknown state in BitfieldReadElement");
|
||||
|
||||
Reference in New Issue
Block a user