From: Oliver Kurth Date: Mon, 3 Jun 2019 20:39:44 +0000 (-0700) Subject: Round out Log functions to all levels X-Git-Tag: stable-11.0.0~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20e8a3d4213019202241d766ba3c7c660c4b74c2;p=thirdparty%2Fopen-vm-tools.git Round out Log functions to all levels Logs would be measurably more useful for debugging if the available levels were used correctly and consistently. As a step towards encouraging such use, define Log_Warning() and Log_Info() as synonyms for Warning() and Log() (which, for historical reasons, are not declared in log.h). Also remove all the conflicting private definitions. --- diff --git a/open-vm-tools/lib/include/log.h b/open-vm-tools/lib/include/log.h index a5b10b87c..bd05f36fe 100644 --- a/open-vm-tools/lib/include/log.h +++ b/open-vm-tools/lib/include/log.h @@ -140,9 +140,21 @@ Log_Error(const char *fmt, } +static INLINE void PRINTF_DECL(1, 2) +Log_Warning(const char *fmt, + ...) +{ + va_list ap; + + va_start(ap, fmt); + LogV(VMW_LOG_WARNING, fmt, ap); + va_end(ap); +} + + static INLINE void PRINTF_DECL(1, 2) Log_Notice(const char *fmt, - ...) + ...) { va_list ap; @@ -152,6 +164,18 @@ Log_Notice(const char *fmt, } +static INLINE void PRINTF_DECL(1, 2) +Log_Info(const char *fmt, + ...) +{ + va_list ap; + + va_start(ap, fmt); + LogV(VMW_LOG_INFO, fmt, ap); + va_end(ap); +} + + static INLINE void PRINTF_DECL(1, 2) Log_Verbose(const char *fmt, ...)