summaryrefslogtreecommitdiff
path: root/meta-ibs/meta-common/recipes-phosphor/interfaces/bmcweb/0011-redfish2phosphor-add-exclude-list.patch
blob: 2815ce68ce1955fb73728f70ce6bc027aed2b132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From bfed159b4875a66b24b21d622da705511c533748 Mon Sep 17 00:00:00 2001
From: "Evgeny Alekseev (IBS Group)" <ealekseev@ibs.sila.ru>
Date: Mon, 19 Sep 2022 13:39:58 +0300
Subject: [PATCH] redfish2phosphor add exclude list

---
 src/redfish2phosphor-logs.cpp | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/redfish2phosphor-logs.cpp b/src/redfish2phosphor-logs.cpp
index 5a19876e..beaf315e 100644
--- a/src/redfish2phosphor-logs.cpp
+++ b/src/redfish2phosphor-logs.cpp
@@ -23,6 +23,9 @@ using namespace std::literals;
 
 static constexpr char ARG_DELIMITER = '$';
 static constexpr auto ARG_COUNT = 4;
+
+static constexpr auto excluded_messages = std::array { "SELEntryAdded" };
+
 enum class level
 {
     EMERG = LOG_EMERG,
@@ -34,6 +37,7 @@ enum class level
     INFO = LOG_INFO,
     DEBUG = LOG_DEBUG,
 };
+
 static level string2severity(std::string_view str)
 {
 
@@ -194,12 +198,14 @@ int main(int argc, char* argv[])
     BMCWEB_LOG_DEBUG << string_msg;
     try
     {
-        dbusCallMethodNoReturn(
-            getBus(), "xyz.openbmc_project.Logging"s,
-            "/xyz/openbmc_project/logging"s,
-            "xyz.openbmc_project.Logging.Create"s, "Create"s,
-            std::string(string_msg), std::string(severity_str),
-            std::array<std::pair<std::string, std::string>, 0>{});
+        if(std::find(excluded_messages.begin(),excluded_messages.end(),std::get<0>(*message)) == excluded_messages.end())
+        {   dbusCallMethodNoReturn(
+                getBus(), "xyz.openbmc_project.Logging"s,
+                "/xyz/openbmc_project/logging"s,
+                "xyz.openbmc_project.Logging.Create"s, "Create"s,
+                std::string(string_msg), std::string(severity_str),
+                std::array<std::pair<std::string, std::string>, 0>{});
+        }
     }
     catch (const sdbusplus::exception_t& ex)
     {