diff --git a/src/util/logging.c b/src/util/logging.c index b8dd8b47602b85e91ba6ad862da2108445482932..34e5167a78958c80f299aeaf781f41e458785177 100644 --- a/src/util/logging.c +++ b/src/util/logging.c @@ -123,6 +123,7 @@ static void virLogOutputToFd(virLogSource src, int linenr, const char *funcname, const char *timestamp, + virLogMetadataPtr metadata, unsigned int flags, const char *rawstr, const char *str, @@ -774,7 +775,7 @@ virLogVMessage(virLogSource source, const char *filename, int linenr, const char *funcname, - virLogMetadataPtr metadata ATTRIBUTE_UNUSED, + virLogMetadataPtr metadata, const char *fmt, va_list vargs) { @@ -845,14 +846,14 @@ virLogVMessage(virLogSource source, if (virLogVersionString(&rawver, &ver) >= 0) virLogOutputs[i].f(VIR_LOG_FROM_FILE, VIR_LOG_INFO, __FILE__, __LINE__, __func__, - timestamp, 0, rawver, ver, + timestamp, NULL, 0, rawver, ver, virLogOutputs[i].data); VIR_FREE(ver); virLogOutputs[i].logVersion = false; } virLogOutputs[i].f(source, priority, filename, linenr, funcname, - timestamp, filterflags, + timestamp, metadata, filterflags, str, msg, virLogOutputs[i].data); } } @@ -863,14 +864,14 @@ virLogVMessage(virLogSource source, if (virLogVersionString(&rawver, &ver) >= 0) virLogOutputToFd(VIR_LOG_FROM_FILE, VIR_LOG_INFO, __FILE__, __LINE__, __func__, - timestamp, 0, rawver, ver, + timestamp, NULL, 0, rawver, ver, (void *) STDERR_FILENO); VIR_FREE(ver); logVersionStderr = false; } virLogOutputToFd(source, priority, filename, linenr, funcname, - timestamp, filterflags, + timestamp, metadata, filterflags, str, msg, (void *) STDERR_FILENO); } virLogUnlock(); @@ -909,6 +910,7 @@ virLogOutputToFd(virLogSource source ATTRIBUTE_UNUSED, int linenr ATTRIBUTE_UNUSED, const char *funcname ATTRIBUTE_UNUSED, const char *timestamp, + virLogMetadataPtr metadata ATTRIBUTE_UNUSED, unsigned int flags, const char *rawstr ATTRIBUTE_UNUSED, const char *str, @@ -995,6 +997,7 @@ virLogOutputToSyslog(virLogSource source ATTRIBUTE_UNUSED, int linenr ATTRIBUTE_UNUSED, const char *funcname ATTRIBUTE_UNUSED, const char *timestamp ATTRIBUTE_UNUSED, + virLogMetadataPtr metadata ATTRIBUTE_UNUSED, unsigned int flags, const char *rawstr ATTRIBUTE_UNUSED, const char *str, @@ -1063,6 +1066,7 @@ virLogOutputToJournald(virLogSource source, int linenr, const char *funcname, const char *timestamp ATTRIBUTE_UNUSED, + virLogMetadataPtr metadata ATTRIBUTE_UNUSED, unsigned int flags, const char *rawstr, const char *str ATTRIBUTE_UNUSED, diff --git a/src/util/logging.h b/src/util/logging.h index 024814fdf11c7a78a9de0d6416013f662c153b78..52feecc371c3ca1738c8a967492c72ca41544ffd 100644 --- a/src/util/logging.h +++ b/src/util/logging.h @@ -111,6 +111,7 @@ typedef struct _virLogMetadata *virLogMetadataPtr; * @linenr: line where the message was emitted * @funcname: the function emitting the message * @timestamp: zero terminated string with timestamp of the message + * @metadata: NULL or metadata array, terminated by an item with NULL key * @flags: flags associated with the message * @rawstr: the unformatted message to log, zero terminated * @str: the message to log, preformatted and zero terminated @@ -124,6 +125,7 @@ typedef void (*virLogOutputFunc) (virLogSource src, int linenr, const char *funcname, const char *timestamp, + virLogMetadataPtr metadata, unsigned int flags, const char *rawstr, const char *str, diff --git a/tests/testutils.c b/tests/testutils.c index 01774238618d0921b39efa50e7dbb12066c4b4e7..3d2e491df60434e2bb059371ae9732975f98b8b3 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -486,6 +486,7 @@ virtTestLogOutput(virLogSource source ATTRIBUTE_UNUSED, int lineno ATTRIBUTE_UNUSED, const char *funcname ATTRIBUTE_UNUSED, const char *timestamp, + virLogMetadataPtr metadata ATTRIBUTE_UNUSED, unsigned int flags, const char *rawstr ATTRIBUTE_UNUSED, const char *str,