提交 37f7a1fa 编写于 作者: M Miloslav Trmač 提交者: Eric Blake

Add metadata to virLogOutputFunc

... and update all users.  No change in functionality, the parameter
will be used in the next patch.
Signed-off-by: NMiloslav Trmač <mitr@redhat.com>
上级 c780e9b8
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册