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>
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 @@
          */
         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 @@
         }
 
     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