]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Change to common header file not applicable to open-vm-tools.
authorKruti Pendharkar <kp025370@broadcom.com>
Tue, 24 Jun 2025 16:26:23 +0000 (09:26 -0700)
committerKruti Pendharkar <kp025370@broadcom.com>
Tue, 24 Jun 2025 16:26:23 +0000 (09:26 -0700)
open-vm-tools/lib/include/log.h

index beca758fb6e73731f25bb1db1417ed04fcfcb02d..13ea91357003c094032a4482c25f8a139f5e9ddc 100644 (file)
@@ -477,9 +477,12 @@ Log_SetVmxStatsData(LogOutput *output,
  * the product should have the dependency, not an underlying library.
  *
  * In complex cases, where an "InitWith" is not sufficient and Log_AddOutput
- * must be used directly, the client should call Log_SetProductInfo, passing
- * the appropriate parameters, so the log file header information will be
- * correct.
+ * must be used directly, the client must call Log_SetProductInfo2, passing
+ * the appropriate parameters, so the logging information will be correct
+ * (e.g. log file header, syslog transmissions).
+ *
+ * The original Log_SetProductInfo continues to exist for compatiblity with
+ * ancient iofilters. It should not be used.
  */
 
 void
@@ -488,13 +491,33 @@ Log_SetProductInfo(const char *appName,
                    const char *buildNumber,
                    const char *compilationOption);
 
+void
+Log_SetProductInfo2(const char *appName,
+                    const char *appVersion,
+                    const char *buildNumber,
+                    const char *compilationOption,
+                    const char *sdCompId);
+
+#if defined(VMX86_SERVER)
+#define VMW_LOG_DEFAULT_SD_COMP_ID "esx"
+#elif defined (__APPLE__)
+#define VMW_LOG_DEFAULT_SD_COMP_ID "fusion"
+#else
+#define VMW_LOG_DEFAULT_SD_COMP_ID "ws"
+#endif
+
+#if !defined(VMW_LOG_SET_SD_COMP_ID)
+#define VMW_LOG_SET_SD_COMP_ID VMW_LOG_DEFAULT_SD_COMP_ID
+#endif
+
 static INLINE void
 Log_SetProductInfoSimple(void)
 {
-   Log_SetProductInfo(ProductState_GetName(),
-                      ProductState_GetVersion(),
-                      ProductState_GetBuildNumberString(),
-                      ProductState_GetCompilationOption());
+   Log_SetProductInfo2(ProductState_GetName(),
+                       ProductState_GetVersion(),
+                       ProductState_GetBuildNumberString(),
+                       ProductState_GetCompilationOption(),
+                       VMW_LOG_SET_SD_COMP_ID);
 }
 
 LogOutput *