Suggestion to change default debug log level
As seen in
https://github.com/KallistiOS/KallistiOS/blob/master/kernel/libc/koslib/dbglog.c
/* Default kernel debug log level: if a message has a level higher than this,
it won't be shown. Set to DBG_DEAD to see basically nothing, and set to
DBG_KDEBUG to see everything. DBG_INFO is generally a decent level. */
int dbglog_level = DBG_KDEBUG;
By default KOS will output every superfluous detail to stdout. Change video mode? It goes right to stdout.
vid_set_mode: 320x240 NTSC with 1 framebuffers.
pvr: enabling vertical scaling for non-VGA
I think this is a quite absurd default, how many other APIs have you used which prints internal details (not even errors, just regular information) to stdout by default? At least making DBG_INFO the default would be a much more sane default, if not DBG_DEAD.
Just kidding. I actually agree with you. I also think a few other details, like "DMA buffer at: 0xblah" should also be hidden as verbose/debug-level information that has no relevance to the user during both startup and shutdown...
While we're on the topic, is there anything useful you WANT to see? I'm kind of thinking there's a bunch of useful shit we're not logging for DBG_NOTICE, like when Maple devices are attached and removed, for example, which would actually be useful to log and capture...
I'd generally agree, we basically already have it: https://github.com/KallistiOS/KallistiOS/blob/dbdc05cf9f64a32b679285c2bb5bb196546407d7/doc/environ.sh.sample#L112-L118
But I think there may be some happier medium for a default between the default high debug we have now and no debug for retail purpose that I understand that define to be providing.
I'd generally agree, we basically already have it:
https://github.com/KallistiOS/KallistiOS/blob/dbdc05cf9f64a32b679285c2bb5bb196546407d7/doc/environ.sh.sample#L112-L118
But I think there may be some happier medium for a default between the default high debug we have now and no debug for retail purpose that I understand that define to be providing.
Oh, there we go... Should we be actually changing what the default log level gets initialized to in KOS for debug versus release builds? Because I don't think we're doing anything like that with that definition--it's just that assert() is honoring it...
Or do we need another configuration option for what to initialize the debug log level to be from the environ.sh?
Random idea, let's compile two versions of KallistiOS - one made for debugging (with -O1 -ggdb -DLOG_LEVEL=Debug) and one made for releases (with -O2 -DNDEBUG -ffast-math and maybe LTO).
The rationale behind this is that the log level is fixed at compilation time, by modifying the print macros we can garbage-collect all dead debug/info strings.