Log: give the printf output the same format as the others

Headless is the only thing that uses it, and it had its own shorter format with
no thread, file or line, so a pattern that matched a log from the app quietly
matched nothing in one from headless. Costs a wrong conclusion the first time
you do it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik Rydgård
2026-09-18 09:45:11 -06:00
co-authored by Claude Opus 5
parent 7ed0598433
commit e6fa47291d
+4 -23
View File
@@ -515,27 +515,8 @@ void LogManager::StdioLog(const LogMessage &message) {
}
void PrintfLog(const LogMessage &message) {
const char *category = message.log;
switch (message.level) {
case LogLevel::LVERBOSE:
fprintf(stderr, "V %s: %s", category, message.msg.c_str());
break;
case LogLevel::LDEBUG:
fprintf(stderr, "D %s: %s", category, message.msg.c_str());
break;
case LogLevel::LINFO:
fprintf(stderr, "I %s: %s", category, message.msg.c_str());
break;
case LogLevel::LERROR:
fprintf(stderr, "E %s: %s", category, message.msg.c_str());
break;
case LogLevel::LWARNING:
fprintf(stderr, "W %s: %s", category, message.msg.c_str());
break;
case LogLevel::LNOTICE:
default:
fprintf(stderr, "N %s: %s", category, message.msg.c_str());
break;
}
// Same shape as the stdio and file outputs the other builds use. It used to be its own
// shorter format, which meant a pattern that matched a log from the app quietly matched
// nothing in one from headless.
fprintf(stderr, "%s %s %s", message.timestamp, message.header, message.msg.c_str());
}