From: Otto Moerbeek Date: Tue, 24 May 2022 06:51:56 +0000 (+0200) Subject: Apply suggestions from code review X-Git-Tag: auth-4.8.0-alpha0~95^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11631%2Fhead;p=thirdparty%2Fpdns.git Apply suggestions from code review Co-authored-by: Charles-Henri Bruyand --- diff --git a/pdns/arguments.cc b/pdns/arguments.cc index b6769ed046..b22da98531 100644 --- a/pdns/arguments.cc +++ b/pdns/arguments.cc @@ -530,7 +530,7 @@ bool ArgvMap::file(const char *fname, bool lax, bool included) if(!parseFile(fname, "", lax)) { SLOG(g_log << Logger::Warning << "Unable to open " << fname << std::endl, - d_log->error(Logr::Warning, "Unable to open", "name", Logging::Loggable(fname))); + d_log->error(Logr::Warning, "Unable to open file", "name", Logging::Loggable(fname))); return false; } @@ -541,7 +541,7 @@ bool ArgvMap::file(const char *fname, bool lax, bool included) for(const std::string& fn : extraConfigs) { if (!file(fn.c_str(), lax, true)) { SLOG(g_log << Logger::Error << fn << " could not be parsed" << std::endl, - d_log->info(Logr::Error, "Could not be parsed", "name", Logging::Loggable(fn))); + d_log->info(Logr::Error, "Unable to parse config file", "name", Logging::Loggable(fn))); throw ArgException(fn + " could not be parsed"); } } @@ -576,7 +576,7 @@ void ArgvMap::gatherIncludes(std::vector &extraConfigs) { if (stat(name.c_str(), &st) || !S_ISREG(st.st_mode)) { string msg = name + " is not a regular file"; SLOG(g_log << Logger::Error << msg << std::endl, - d_log->info(Logr::Error, "Is not a regular file", "name", Logging::Loggable(name))); + d_log->info(Logr::Error, "Unable to open non-regular file", "name", Logging::Loggable(name))); closedir(dir); throw ArgException(msg); } diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index f5819dffb6..b8b6b3e65f 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -1238,7 +1238,7 @@ static int serviceMain(int argc, char* argv[], std::shared_ptr& lo } catch (std::exception& e) { SLOG(g_log << Logger::Error << "Assigning local query addresses: " << e.what(), - log->error(Logr::Error, e.what(), "Assigning local query address")); + log->error(Logr::Error, e.what(), "Unable to assign local query address")); exit(99); }