From: Otto Moerbeek Date: Tue, 21 Jun 2022 13:19:29 +0000 (+0200) Subject: Process review comments X-Git-Tag: auth-4.8.0-alpha0~48^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11693%2Fhead;p=thirdparty%2Fpdns.git Process review comments --- diff --git a/pdns/webserver.cc b/pdns/webserver.cc index 7dfd567821..7803989010 100644 --- a/pdns/webserver.cc +++ b/pdns/webserver.cc @@ -167,7 +167,7 @@ void WebServer::apiWrapper(const WebServer::HandlerFunction& handler, HttpReques if (!d_apikey) { SLOG(g_log<logprefix<<"HTTP API Request \"" << req->url.path << "\": Authentication failed, API Key missing in config" << endl, - d_slog->info(Logr::Error, "HTTP API Request: Authentication failed, API Key missing in config", "urlpath", Logging::Loggable(req->url.path))); + d_slog->info(Logr::Error, "Authentication failed, API Key missing in config", "urlpath", Logging::Loggable(req->url.path))); throw HttpUnauthorizedException("X-API-Key"); } @@ -183,7 +183,7 @@ void WebServer::apiWrapper(const WebServer::HandlerFunction& handler, HttpReques if (!auth_ok) { SLOG(g_log<logprefix<<"HTTP Request \"" << req->url.path << "\": Authentication by API Key failed" << endl, - d_slog->info(Logr::Error, "HTTP Request: Authentication by API Key failed", "urlpath", Logging::Loggable(req->url.path))); + d_slog->info(Logr::Error, "Authentication by API Key failed", "urlpath", Logging::Loggable(req->url.path))); throw HttpUnauthorizedException("X-API-Key"); } @@ -498,6 +498,7 @@ void WebServer::serveConnection(const std::shared_ptr& client) const { d_slog->error(Logr::Warning, e.what(), "Unable to parse request")); } + // Uses of `remote` below guarded by d_loglevel if (d_loglevel > WebServer::LogLevel::None) { client->getRemote(remote); } diff --git a/pdns/ws-recursor.cc b/pdns/ws-recursor.cc index db66ea295f..16b6a195fc 100644 --- a/pdns/ws-recursor.cc +++ b/pdns/ws-recursor.cc @@ -1163,7 +1163,7 @@ static void validatePrometheusMetrics() if (!s_metricDefinitions.getMetricDetails(metricName, metricDetails)) { SLOG(g_log << Logger::Debug << "{ \"" << metricName << "\", MetricDefinition(PrometheusMetricType::counter, \"\")}," << endl, - g_slog->ingo(Logr::Debug, "{ \"" << metricName << "\", MetricDefinition(PrometheusMetricType::counter, \"\")},")); + g_slog->info(Logr::Debug, "{ \"" << metricName << "\", MetricDefinition(PrometheusMetricType::counter, \"\")},")); } } }