Logging refactor
Refactor to logging to make it more readable ( eg currently you can use both spdlog::info and NS::log::NS->info, this is bad )
Rough list of things:
- [x] Refactor logging functions
- [x] More logging categories
- [x] Separate log files into a folder
- Current idea is: ( Very much up to discussion )
└── %Y-%m-%d_%H-%M-%S/ ├── native.txt ├── warning.txt ├── error.txt ├── script.txt ├── script_warning.txt ├── crash.txt └── minidump.dmp
- Current idea is: ( Very much up to discussion )
- ~~[ ] Print system and northstar information~~
- ~~[ ] Ability to toggle ( most likely through a launch arg ) what is logged into gameconsole~~
- [x] `-wconsole` arg to disable windows terminal
- [x] Fix crashlogs not flushing to file
Depends on ( and should preferably be shipped with ): #477
( eg currently you can use both
spdlog::infoandNS::log::NS->info, this is bad )
Yup, glad to see a change on that :eyes:
Separate log files into a folder
- Current idea is: ( Very much up to discussion )
I would keep the logs in a single file. Given the log prefix one can still strip out certain parts by e.g. using grep. Splitting it up into different files means that when a helper requests a user to upload current logs, the user then has to zip up the entire folder and then upload that. This might not seem like much effort but if you ever interacted with tickets you know that this will be problematic xD
I would keep the logs in a single file. Given the log prefix one can still strip out certain parts by e.g. using
grep.
The main reason i want to wrap them in a folder is separating the crash message into a separate file. Perhaps it could even be a json so that other apps could parse it
Splitting it up into different files means that when a helper requests a user to upload current logs, the user then has to zip up the entire folder and then upload that. This might not seem like much effort but if you ever interacted with tickets you know that this will be problematic xD
I can see some users really struggling with this. Even with improving error handling ( script errors, ... ) this would still be a problem.
I would keep the logs in a single file. Given the log prefix one can still strip out certain parts by e.g. using
grep.The main reason i want to wrap them in a folder is separating the crash message into a separate file. Perhaps it could even be a json so that other apps could parse it
If the crash is caused by a mod, then having information about which mods are loaded in the same file would be quite useful in my eyes ^^
I assume whether it's stored in one file or multiple can be easily adjusted by just modifying the code related to the logger backend? In which case switching between the two should be rather simple once we decide which mode to choose (I'd still argue for single file :P)
I assume whether it's stored in one file or multiple can be easily adjusted by just modifying the code related to the logger backend? In which case switching between the two should be rather simple once we decide which mode to choose (I'd still argue for single file :P)
spdlog makes it really easy to switch between the configurations, so for the sake of testing i could implement it so that we know which one has more pros
I'd say this is pretty much done, just waiting on #477
@F1F7Y am I correct assuming assuming that this is basically the same as #617 ?
(Also I just noticed that the label for dependent PR was never removed when #477 was merged causing this PR to be stuck in PR hell, ugh. We really need some way to automate this as otherwise it will become impossible to keep track of stuff in the long run)
@F1F7Y am I correct assuming assuming that this is basically the same as #617 ?
Unless i missed some change it should be yeah.