]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes in shared code that don't affect open-vm-tools functionality.
authorVMware, Inc <>
Tue, 24 Aug 2010 18:10:34 +0000 (11:10 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 24 Aug 2010 18:10:34 +0000 (11:10 -0700)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/include/log.h

index c83c70b36781f7a3b288995a7c36c6e20ae67cea..d9aa1457e758d6199c697506a1a03ae7768a9420 100644 (file)
 
 #include <stdarg.h>
 
+/*
+ * The log levels are taken from POSIXen syslog. We hijack their values
+ * on POSIXen and provide equivalent defines on all other platforms.
+ */
+
+#if defined(_WIN32)
+#   include <windows.h>
+
+#   define LOG_INFO       EVENTLOG_INFORMATION_TYPE
+#   define LOG_WARNING    EVENTLOG_WARNING_TYPE
+#   define LOG_ERR        EVENTLOG_ERROR_TYPE
+#else
+#   if !defined(VMM)
+#      include <syslog.h>
+#   endif
+#endif
+
 
 typedef void (LogBasicFunc)(const char *fmt, va_list args);
 
@@ -53,6 +70,8 @@ typedef struct
 
    SysLogger      systemLoggerUse;      // System logger options
    const char    *systemLoggerID;       // Identifier for system logger
+
+   Bool           stderrWarnings;       // warning also to stderr?
 } LogInitParams;
 
 void Log_GetInitDefaults(const char *fileName,
@@ -116,6 +135,14 @@ void LogV(const char *fmt,
 void WarningV(const char *fmt,
               va_list args);
 
+void Log_Level(int level,
+               const char *fmt,
+               ...);
+
+void Log_LevelV(int level,
+                const char *fmt,
+                va_list args);
+
 /* Logging that uses the custom guest throttling configuration. */
 void GuestLog_Init(void);
 void GuestLog_Log(const char *fmt, ...) PRINTF_DECL(1, 2);