diff --git a/src/protocols/vnc/log.c b/src/protocols/vnc/log.c index ba593e81d0..6d3f85ac94 100644 --- a/src/protocols/vnc/log.c +++ b/src/protocols/vnc/log.c @@ -34,7 +34,15 @@ #include #include #include + +/* + * Syslog does not exist on Windows, so we'll just log directly to std error. + * TODO: ReportEvent() might be sort of equivalent? Look into + * https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-reporteventa + */ +#ifndef WINDOWS_BUILD #include +#endif void guac_vnc_client_log_info(const char* format, ...) { @@ -46,8 +54,12 @@ void guac_vnc_client_log_info(const char* format, ...) { vsnprintf(message, sizeof(message), format, args); va_end(args); +#ifndef WINDOWS_BUILD /* Log to syslog */ syslog(LOG_INFO, "%s", message); +#else + fprintf(stderr, "INFO: %s\n", message); +#endif } @@ -61,8 +73,12 @@ void guac_vnc_client_log_error(const char* format, ...) { vsnprintf(message, sizeof(message), format, args); va_end(args); +#ifndef WINDOWS_BUILD /* Log to syslog */ syslog(LOG_ERR, "%s", message); +#else + fprintf(stderr, "ERROR: %s\n", message); +#endif }