jak-project icon indicating copy to clipboard operation
jak-project copied to clipboard

logs: replace almost every `fmt::print` with a `lg` call instead

Open xTVaser opened this issue 2 years ago • 3 comments

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

xTVaser avatar May 20 '22 19:05 xTVaser

Yeah, the timestamp thing is partly why I suggested a lg::print instead of changing everything to lg::debug and stuff. It's cluttery.

ManDude avatar May 22 '22 01:05 ManDude

imo the vast majority of the prints I replaced should be using a lg::debug/info/error/etc so they actually have some context / can be disabled in a somewhat decent way.

But yeah there were some, as mentioned above, that should stay as a normal print (or be refactored more in-depth). A lg::print would be a good candidate for these.

As for the timestamp being dense, thoughts on just disabling that in the stdout output?

xTVaser avatar May 22 '22 01:05 xTVaser

I think we can condense them a little bit. I do not believe the milliseconds are useful, for example.

ManDude avatar May 22 '22 02:05 ManDude