ACE
ACE copied to clipboard
Unify logging
- Currently there is game.log and memory.log. Having mem logged in separate file makes it hard to determine where and when specifically given alloc is taking place.
- To unify it into single file, we need something to differentiate mem and other stuff in clean and filterable/searchable way (as easy as ctrl+f). Also, game logging should be distinct from ACE stuff, but still in same file.
- We lack standard means to print warnings and errors. Currently I mostly use
WARN:
andERR:
prefixes, but some messages aren't still conforming to this. When other contributions arrive, it's going to be even bigger mess. Having fns likelogErr
,logWarn
andlogInfo
might be a good idea. - Log categories could be mutable (as in mute) so that reading logs would be easier. But it's something that can be bypassed by filtering.
- Also, logs should have no footprint on release builds and be non-existent there.
Any ideas?
I've started doing this but needs further work, I think
- [x] move memory and general logging to same output
- [x] add ability to output to file or WinUAE debug console
- [ ] add consistent log message types (warning, error, info, etc.)
the most scalable approach would be having log fn such as logWrite(szType, szMsg)
, but there is a consistency problem with szType categories - easy for typos. We could tackle it by enforcing codestyle for using preprocessor-defined strings as first arg.