-
Notifications
You must be signed in to change notification settings - Fork 148
Open
Description
I like that there's a way to remove the echo from nob.h but shouldn't it just be one of the options in Nob_Log_Level?
That way there would be no need to special case it by using NOB_NO_ECHO.
typedef enum {
NOB_ECHO = -1,
NOB_INFO,
NOB_WARNING,
NOB_ERROR,
NOB_NO_LOGS,
} Nob_Log_Level;
// ...
NOBDEF void nob_log(Nob_Log_Level level, const char *fmt, ...)
{
if (level < nob_minimal_log_level) return;
switch (level) {
case NOB_ECHO:
case NOB_INFO:
fprintf(stderr, "[INFO] ");
break;
case NOB_WARNING:
fprintf(stderr, "[WARNING] ");
break;
case NOB_ERROR:
fprintf(stderr, "[ERROR] ");
break;
case NOB_NO_LOGS: return;
default:
NOB_UNREACHABLE("nob_log");
}
// ...Metadata
Metadata
Assignees
Labels
No labels