summaryrefslogtreecommitdiffstats
path: root/log_manager.hpp
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2018-04-03 02:08:42 -0500
committerDeepak Kodihalli <dkodihal@in.ibm.com>2018-04-09 08:42:53 -0500
commit6fd9dc48615e22d53be7181fb8d122f67695036e (patch)
treebc0659aea48ae59f15eb16b6b83345f9c595bed4 /log_manager.hpp
parent14a8c8de981933fdb362597d7cf989249846ee9f (diff)
downloadphosphor-logging-6fd9dc48615e22d53be7181fb8d122f67695036e.tar.gz
phosphor-logging-6fd9dc48615e22d53be7181fb8d122f67695036e.zip
Implement ability to override default error level
Errors reported by the phosphor-logging app have a default error level, and this level is specified in the error's YAML definition. Enable users of the error's report() API to specify an error level. A user may perceive a different error level for an error scenario, for eg there may be certain host errors (for which we set the level as 'Error') that may just be 'Warnings'. Change-Id: I666a0ddcb099e530c423358a3b1c65f33b0ad01e Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'log_manager.hpp')
-rw-r--r--log_manager.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/log_manager.hpp b/log_manager.hpp
index b165ff3..9339a6f 100644
--- a/log_manager.hpp
+++ b/log_manager.hpp
@@ -68,6 +68,19 @@ class Manager : public details::ServerObject<details::ManagerIface>
*/
void commit(uint64_t transactionId, std::string errMsg) override;
+ /*
+ * @fn commit()
+ * @brief sd_bus CommitWithLvl method implementation callback.
+ * @details Create an error/event log based on transaction id and
+ * error message.
+ * @param[in] transactionId - Unique identifier of the journal entries
+ * to be committed.
+ * @param[in] errMsg - The error exception message associated with the
+ * error log to be committed.
+ * @param[in] errLvl - level of the error
+ */
+ void commitWithLvl(uint64_t transactionId, std::string errMsg,
+ uint32_t errLvl) override;
/** @brief Erase specified entry d-bus object
*
@@ -95,6 +108,18 @@ class Manager : public details::ServerObject<details::ManagerIface>
}
private:
+ /*
+ * @fn _commit()
+ * @brief commit() helper
+ * @param[in] transactionId - Unique identifier of the journal entries
+ * to be committed.
+ * @param[in] errMsg - The error exception message associated with the
+ * error log to be committed.
+ * @param[in] errLvl - level of the error
+ */
+ void _commit(uint64_t transactionId, std::string&& errMsg,
+ Entry::Level errLvl);
+
/** @brief Call metadata handler(s), if any. Handlers may create
* associations.
* @param[in] errorName - name of the error
OpenPOWER on IntegriCloud