]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix format string
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 3 May 2022 18:59:23 +0000 (19:59 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 3 May 2022 18:59:23 +0000 (19:59 +0100)
src/libserver/symcache/symcache_item.hxx
src/libserver/symcache/symcache_runtime.cxx

index e702fa0db6c87d6185b212db6917ace4023265aa..a905df09b83621391152b8e0369fba144798e667 100644 (file)
@@ -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
index acfec5e8ae9e649e403edf682404d38483a5d2c6..c8c8e9e894b7627d76cb2fcc3c817e72d16a4605 100644 (file)
@@ -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);