Move the monitor application to lg2
Update the logging API used for files in phosphor-fan-presence/monitor
from the older phosphor::logging::log to the more recent lg2::log.
Tested:
* Verified journal traces worked correctly in simulation.
* Modified json and simulation parameters to force various
application errors and verified correct output and key/value
pairs using journalctl.
Change-Id: Id6f5161edfd09b672aba8751a6d2c6518665188a
Signed-off-by: Anwaar Hadi <anwaar.hadi@ibm.com>
diff --git a/monitor/tach_sensor.hpp b/monitor/tach_sensor.hpp
index 74eede6..1dea170 100644
--- a/monitor/tach_sensor.hpp
+++ b/monitor/tach_sensor.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <sdbusplus/bus.hpp>
#include <sdbusplus/bus/match.hpp>
#include <sdeventplus/clock.hpp>
@@ -9,7 +9,6 @@
#include <chrono>
#include <deque>
-#include <format>
#include <optional>
#include <utility>
@@ -284,9 +283,7 @@
*/
inline void stopTimer()
{
- phosphor::logging::log<phosphor::logging::level::DEBUG>(
- std::format("Stop running timer on tach sensor {}.", _name)
- .c_str());
+ lg2::debug("Stop running timer on tach sensor {NAME}.", "NAME", _name);
_timer.setEnabled(false);
}