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.

(cherry picked from commit c492c90)
  • Loading branch information
qris committed Jan 8, 2018
1 parent 13e66ee commit ed50078
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 ed50078

Please sign in to comment.