diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2024-07-15 17:57:42 +0200 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-07-15 19:16:27 +0200 |
| commit | c51ea9f44e9742c88a252b86cb0260798b4b9f7b (patch) | |
| tree | 665e290c7c9d5fa79030188004ca4843c67ab4c5 /methods | |
| parent | 761852064521d9f34d3179c002427658342b6f03 (diff) | |
worker: Add an audit level to log audit messages
Diffstat (limited to 'methods')
| -rw-r--r-- | methods/aptmethod.h | 12 |
1 files changed, 10 insertions, 2 deletions
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<std::string, std::string> 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) |
