From c51ea9f44e9742c88a252b86cb0260798b4b9f7b Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 15 Jul 2024 17:57:42 +0200 Subject: worker: Add an audit level to log audit messages --- methods/aptmethod.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'methods') diff --git a/methods/aptmethod.h b/methods/aptmethod.h index 26b8c0b55..1c24f3a98 100644 --- a/methods/aptmethod.h +++ b/methods/aptmethod.h @@ -448,7 +448,7 @@ protected: return true; } - void Warning(std::string &&msg) + void Message(std::string &&msg, std::string code) { std::unordered_map fields; if (Queue != 0) @@ -458,7 +458,15 @@ protected: if (not UsedMirror.empty()) fields.emplace("UsedMirror", UsedMirror); fields.emplace("Message", std::move(msg)); - SendMessage("104 Warning", std::move(fields)); + SendMessage(code, std::move(fields)); + } + void Warning(std::string &&msg) + { + return Message(std::move(msg), "104 Warning"); + } + void Audit(std::string &&msg) + { + return Message(std::move(msg), "105 Audit"); } bool TransferModificationTimes(char const * const From, char const * const To, time_t &LastModified) APT_NONNULL(2, 3) -- cgit v1.2.3-70-g09d2