]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Add --log-tag option for rspamc
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 29 Jul 2025 09:06:35 +0000 (10:06 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 29 Jul 2025 09:06:35 +0000 (10:06 +0100)
src/client/rspamc.cxx

index 04bbaeac858da059b8cca7b6dff0c783abab1a08..1dc48faaec551cdd8a4f78269ae941c6941c1094 100644 (file)
@@ -92,6 +92,7 @@ static const char *pubkey = nullptr;
 static const char *user_agent = "rspamc";
 static const char *files_list = nullptr;
 static const char *queue_id = nullptr;
+static const char *log_tag = nullptr;
 static std::string settings;
 
 std::vector<GPid> children;
@@ -192,6 +193,8 @@ static GOptionEntry entries[] =
                 "Read one or more newline separated filenames to scan from file", nullptr},
                {"queue-id", '\0', 0, G_OPTION_ARG_STRING, &queue_id,
                 "Set Queue-ID header for the request", nullptr},
+               {"log-tag", '\0', 0, G_OPTION_ARG_STRING, &log_tag,
+                "Set Log-Tag header for the request", nullptr},
                {"settings", '\0', 0, G_OPTION_ARG_CALLBACK, (void *) &rspamc_settings_callback,
                 "Set Settings header as JSON/UCL for the request", nullptr},
                {nullptr, 0, 0, G_OPTION_ARG_NONE, nullptr, nullptr, nullptr}};
@@ -945,6 +948,10 @@ add_options(GQueue *opts)
                add_client_header(opts, "Queue-Id", queue_id);
        }
 
+       if (log_tag != nullptr) {
+               add_client_header(opts, "Log-Tag", log_tag);
+       }
+
        if (!settings.empty()) {
                add_client_header(opts, "Settings", settings.c_str());
        }