Implement a cap on the number of committed errors
Resolves openbmc/openbmc#1617
Change-Id: I5850e5addb723e6f5102eb4677bb365285c1a633
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
diff --git a/log_manager.hpp b/log_manager.hpp
index 730f63e..f366684 100644
--- a/log_manager.hpp
+++ b/log_manager.hpp
@@ -46,7 +46,8 @@
Manager(sdbusplus::bus::bus& bus, const char* objPath) :
details::ServerObject<details::ManagerIface>(bus, objPath),
busLog(bus),
- entryId(0) {};
+ entryId(0),
+ capped(false) {};
/*
* @fn commit()
@@ -91,6 +92,16 @@
/** @brief Id of last error log entry */
uint32_t entryId;
+
+ /**
+ * @brief Flag to log error for the first time when error cap is
+ * reached.
+ * @details Flag used to log error message for the first time when the
+ * error cap value is reached. It is reset when user delete's error
+ * entries and total entries existing is less than the error cap
+ * value.
+ */
+ bool capped;
};
} // namespace logging