[geary/wip/logging-output-fixes: 2/2] Fix missing structured fields in extended Geary.Logging calls
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/logging-output-fixes: 2/2] Fix missing structured fields in extended Geary.Logging calls
- Date: Sat, 10 Aug 2019 01:57:00 +0000 (UTC)
commit bf2781f5be92b5bc925c523f1811939f23ed6888
Author: Michael Gratton <mike vee net>
Date: Sat Aug 10 11:56:07 2019 +1000
Fix missing structured fields in extended Geary.Logging calls
src/engine/api/geary-logging.vala | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/engine/api/geary-logging.vala b/src/engine/api/geary-logging.vala
index e693e810..6fd0419e 100644
--- a/src/engine/api/geary-logging.vala
+++ b/src/engine/api/geary-logging.vala
@@ -436,13 +436,20 @@ public inline void logv(Flag flags,
string fmt,
va_list args) {
if (flags == ALL || logging_flags.is_any_set(flags)) {
- string formatted = fmt.vprintf(args);
- GLib.LogField<string> message = GLib.LogField<string>();
- message.key = "MESSAGE";
- message.length = -1;
- message.value = formatted;
-
- GLib.log_structured_array(level, { message });
+ GLib.log_structured_array(
+ level,
+ new GLib.LogField[] {
+ GLib.LogField<string>() {
+ key = "GLIB_DOMAIN", value = DOMAIN, length = -1
+ },
+ GLib.LogField<Flag>() {
+ key = "GEARY_FLAGS", value = flags, length = 0
+ },
+ GLib.LogField<string>() {
+ key = "MESSAGE", value = fmt.vprintf(args), length = -1
+ }
+ }
+ );
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]