Convert from log() to lg2()
Convert from the old log() API to the new lg2() API for logging journal
messages. The new API is simpler to use, and the old API may be
deprecated in the future.
Tested:
* Tested all lg2() calls to verify the resulting journal message was
correct.
* For the complete test plan, see
https://gist.github.com/smccarney/f4ed140bf7a46773b31c76b488e739dc
Change-Id: Ieb46c5d1481ceb51e5b0d51392b1c32596d8eac8
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/src/version.cpp b/src/version.cpp
index f64e4ad..74664d8 100644
--- a/src/version.cpp
+++ b/src/version.cpp
@@ -3,7 +3,8 @@
#include "item_updater.hpp"
#include <phosphor-logging/elog-errors.hpp>
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/elog.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
#include <fstream>
@@ -28,7 +29,7 @@
{
if (filePath.empty())
{
- log<level::ERR>("Error filePath is empty");
+ lg2::error("Error filePath is empty");
elog<InvalidArgument>(Argument::ARGUMENT_NAME("FilePath"),
Argument::ARGUMENT_VALUE(filePath.c_str()));
}