commit 36979bd: [Minor] Fix format string
Vsevolod Stakhov
vsevolod at rspamd.com
Tue May 3 19:35:03 UTC 2022
Author: Vsevolod Stakhov
Date: 2022-05-03 19:59:23 +0100
URL: https://github.com/rspamd/rspamd/commit/36979bdb356286b0648ed7745b11c4575638a074
[Minor] Fix format string
---
src/libserver/symcache/symcache_item.hxx | 21 +++++++++++++++++++++
src/libserver/symcache/symcache_runtime.cxx | 2 +-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/libserver/symcache/symcache_item.hxx b/src/libserver/symcache/symcache_item.hxx
index e702fa0db..a905df09b 100644
--- a/src/libserver/symcache/symcache_item.hxx
+++ b/src/libserver/symcache/symcache_item.hxx
@@ -55,6 +55,27 @@ enum class symcache_item_type {
*/
bool operator<(symcache_item_type lhs, symcache_item_type rhs);
+constexpr static auto item_type_to_str(symcache_item_type t) -> const char * {
+ switch(t) {
+ case symcache_item_type::CONNFILTER:
+ return "connfilter";
+ case symcache_item_type::PREFILTER:
+ return "prefilter";
+ case symcache_item_type::FILTER:
+ return "filter";
+ case symcache_item_type::POSTFILTER:
+ return "postfilter";
+ case symcache_item_type::IDEMPOTENT:
+ return "idempotent";
+ case symcache_item_type::CLASSIFIER:
+ return "classifier";
+ case symcache_item_type::COMPOSITE:
+ return "composite";
+ case symcache_item_type::VIRTUAL:
+ return "virtual";
+ }
+}
+
/**
* This is a public helper to convert a legacy C type to a more static type
* @param type input type as a C enum
diff --git a/src/libserver/symcache/symcache_runtime.cxx b/src/libserver/symcache/symcache_runtime.cxx
index acfec5e8a..c8c8e9e89 100644
--- a/src/libserver/symcache/symcache_runtime.cxx
+++ b/src/libserver/symcache/symcache_runtime.cxx
@@ -503,7 +503,7 @@ symcache_runtime::process_symbol(struct rspamd_task *task, symcache &cache, cach
if (check) {
msg_debug_cache_task("execute %s, %d; symbol type = %s", item->symbol.data(),
- item->id);
+ item->id, item_type_to_str(item->type));
if (profile) {
ev_now_update_if_cheap(task->event_loop);
More information about the Commits
mailing list