regulators: Modify Configuration to use Journal
Modify Configuration::execute() to log messages using
the new Journal interface.
Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: If7dee12ca064147386fc076223474f004281d7ec
diff --git a/phosphor-regulators/src/chassis.cpp b/phosphor-regulators/src/chassis.cpp
index ebe446c..4a016e6 100644
--- a/phosphor-regulators/src/chassis.cpp
+++ b/phosphor-regulators/src/chassis.cpp
@@ -46,7 +46,8 @@
void Chassis::configure(Services& services, System& system)
{
// Log info message in journal; important for verifying success of boot
- journal::logInfo("Configuring chassis " + std::to_string(number));
+ services.getJournal().logInfo("Configuring chassis " +
+ std::to_string(number));
// Configure devices
for (std::unique_ptr<Device>& device : devices)
diff --git a/phosphor-regulators/src/configuration.cpp b/phosphor-regulators/src/configuration.cpp
index 8edc36c..81b2c17 100644
--- a/phosphor-regulators/src/configuration.cpp
+++ b/phosphor-regulators/src/configuration.cpp
@@ -21,7 +21,6 @@
#include "chassis.hpp"
#include "device.hpp"
#include "exception_utils.hpp"
-#include "journal.hpp"
#include "rail.hpp"
#include "system.hpp"
@@ -42,7 +41,7 @@
execute(services, system, chassis, device, rail.getID());
}
-void Configuration::execute(Services& /*services*/, System& system,
+void Configuration::execute(Services& services, System& system,
Chassis& /*chassis*/, Device& device,
const std::string& deviceOrRailID)
{
@@ -54,7 +53,7 @@
{
message += ": volts=" + std::to_string(volts.value());
}
- journal::logDebug(message);
+ services.getJournal().logDebug(message);
// Create ActionEnvironment
ActionEnvironment environment{system.getIDMap(), device.getID()};
@@ -69,8 +68,8 @@
catch (const std::exception& e)
{
// Log error messages in journal
- exception_utils::log(e);
- journal::logErr("Unable to configure " + deviceOrRailID);
+ services.getJournal().logError(exception_utils::getMessages(e));
+ services.getJournal().logError("Unable to configure " + deviceOrRailID);
// TODO: Create error log entry
}