logging: switch networkd static_library to lg2
This commit switches logging to lg2 in the following files -
1. src/dhcp_configuration.cpp
2. src/dhcp_configuration.cpp
3. src/ipaddress.cpp
4. src/system_configuration.cpp
5. src/system_queries.cpp
Tested: Build passes with "ninja -C build".
Change-Id: I492c7579c968810b783836b652e450ff89b8cd4b
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/src/ipaddress.cpp b/src/ipaddress.cpp
index 62ac220..2235550 100644
--- a/src/ipaddress.cpp
+++ b/src/ipaddress.cpp
@@ -5,7 +5,7 @@
#include "util.hpp"
#include <phosphor-logging/elog-errors.hpp>
-#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <stdexcept>
#include <string>
#include <string_view>
@@ -91,10 +91,10 @@
{
if (origin() != IP::AddressOrigin::Static)
{
- log<level::ERR>("Tried to delete a non-static address"),
- entry("ADDRESS=%s", address().c_str()),
- entry("PREFIX=%" PRIu8, prefixLength()),
- entry("INTERFACE=%s", parent.get().interfaceName().c_str());
+ lg2::error("Tried to delete a non-static address {IP_ADDRESS} prefix "
+ "{PREFIX} interface {INTERFACE_NAME}",
+ "IP_ADDRESS", address(), "PREFIX", prefixLength(),
+ "INTERFACE_NAME", parent.get().interfaceName());
elog<InternalFailure>();
}