aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/client/rspamc.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/rspamc.cxx b/src/client/rspamc.cxx
index 3615d3be5..cb847bf5b 100644
--- a/src/client/rspamc.cxx
+++ b/src/client/rspamc.cxx
@@ -1030,8 +1030,16 @@ rspamc_symbols_output(FILE *out, ucl_object_t *obj)
const ucl_object_t *cmesg;
while ((cmesg = ucl_object_iterate (elt, &mit, true)) != nullptr) {
- fmt::print(out, "Message - {}: {}\n",
- ucl_object_key(cmesg), ucl_object_tostring(cmesg));
+ if (ucl_object_type(cmesg) == UCL_STRING) {
+ fmt::print(out, "Message - {}: {}\n",
+ ucl_object_key(cmesg), ucl_object_tostring(cmesg));
+ } else {
+ unsigned char *rendered_message;
+ rendered_message = ucl_object_emit(cmesg, UCL_EMIT_JSON_COMPACT);
+ fmt::print(out, "Message - {}: {:.60}\n",
+ ucl_object_key(cmesg), rendered_message);
+ free(rendered_message);
+ }
}
}