From 2694f81462c6ab695bbb3ac1ac77fa795ea394d6 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Thu, 10 Aug 2023 18:02:54 +0200 Subject: Revert "Silence nifm spam" This reverts commit 4da4ecb1ff79798fe245a0c6c483405f998cd093. --- src/core/internal_network/network.cpp | 8 +++++++- src/core/internal_network/network_interface.cpp | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/internal_network/network.cpp b/src/core/internal_network/network.cpp index 28f89c599..bda9fa2e0 100644 --- a/src/core/internal_network/network.cpp +++ b/src/core/internal_network/network.cpp @@ -476,7 +476,13 @@ NetworkInstance::~NetworkInstance() { std::optional GetHostIPv4Address() { const auto network_interface = Network::GetSelectedNetworkInterface(); if (!network_interface.has_value()) { - LOG_DEBUG(Network, "GetSelectedNetworkInterface returned no interface"); + // Only print the error once to avoid log spam + static bool print_error = true; + if (print_error) { + LOG_ERROR(Network, "GetSelectedNetworkInterface returned no interface"); + print_error = false; + } + return {}; } diff --git a/src/core/internal_network/network_interface.cpp b/src/core/internal_network/network_interface.cpp index 4c909a6d3..7c37f660b 100644 --- a/src/core/internal_network/network_interface.cpp +++ b/src/core/internal_network/network_interface.cpp @@ -200,7 +200,14 @@ std::optional GetSelectedNetworkInterface() { }); if (res == network_interfaces.end()) { - LOG_DEBUG(Network, "Couldn't find selected interface \"{}\"", selected_network_interface); + // Only print the error once to avoid log spam + static bool print_error = true; + if (print_error) { + LOG_ERROR(Network, "Couldn't find selected interface \"{}\"", + selected_network_interface); + print_error = false; + } + return std::nullopt; } -- cgit v1.2.3