diff --git a/userspace/libraries/LibC/syslog.cpp b/userspace/libraries/LibC/syslog.cpp index 136d820c..5f2789e5 100644 --- a/userspace/libraries/LibC/syslog.cpp +++ b/userspace/libraries/LibC/syslog.cpp @@ -1,13 +1,16 @@ -#include - #include #include #include static const char* s_ident = nullptr; +static FILE* s_log_file = nullptr; + void openlog(const char* ident, int option, int facility) { + if (s_log_file == nullptr) + s_log_file = fopen("/dev/debug", "w"); + (void)option; (void)facility; s_ident = ident; @@ -17,14 +20,16 @@ void syslog(int priority, const char* format, ...) { (void)priority; if (s_ident) - fprintf(stddbg, "%s", s_ident); + fprintf(s_log_file, "%s", s_ident); va_list args; va_start(args, format); - vfprintf(stddbg, format, args); + vfprintf(s_log_file, format, args); va_end(args); } void closelog() { + fclose(s_log_file); + s_log_file = nullptr; s_ident = nullptr; }