Skip to content

Commit

Permalink
Windows syslog() emulation: improve error messages
Browse files Browse the repository at this point in the history
If syslog can't log to the Windows event log for some reason, instead of
just printing the log message to the console, include some explanatory
text about what went wrong.
  • Loading branch information
qris committed Nov 17, 2017
1 parent 756c14b commit 6431353
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/win32/emu.cpp
Expand Up @@ -1531,7 +1531,7 @@ void syslog(int loglevel, const char *frmt, ...)
assert(len >= 0);
if (len < 0)
{
printf("%s\r\n", buffer);
printf("<syslog(): message too long> %s\r\n", buffer);
fflush(stdout);
return;
}
Expand All @@ -1543,7 +1543,7 @@ void syslog(int loglevel, const char *frmt, ...)

if (gSyslogH == INVALID_HANDLE_VALUE)
{
printf("%s\r\n", buffer);
printf("<syslog(): invalid handle> %s\r\n", buffer);
fflush(stdout);
return;
}
Expand Down

0 comments on commit 6431353

Please sign in to comment.