From: Otto Moerbeek Date: Wed, 4 May 2022 08:57:45 +0000 (+0200) Subject: Tweaks wrt explicit priority. X-Git-Tag: auth-4.8.0-alpha0~95^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb29e22582f99d45748f3137d89b1e9bef50e5ba;p=thirdparty%2Fpdns.git Tweaks wrt explicit priority. It should be made less easy to make mistakes here. --- diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index 6a0228eca2..9c6b6f2447 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -2638,7 +2638,7 @@ int main(int argc, char** argv) if (!::arg()["chroot"].empty() && !::arg()["api-config-dir"].empty()) { SLOG(g_log << Logger::Error << "Using chroot and enabling the API is not possible" << endl, - startupLog->info("Cannot use chroot and enable the API at the same time")); + startupLog->info(Logr::Error, "Cannot use chroot and enable the API at the same time")); exit(EXIT_FAILURE); } @@ -2672,16 +2672,19 @@ int main(int argc, char** argv) ret = serviceMain(argc, argv); } - catch (PDNSException& ae) { - g_log << Logger::Error << "Exception: " << ae.reason << endl; + catch (const PDNSException& ae) { + SLOG(g_log << Logger::Error << "Exception: " << ae.reason << endl, + g_slog->withName("startup")->error(Logr::Error, "Exception", ae.reason)); ret = EXIT_FAILURE; } - catch (std::exception& e) { - g_log << Logger::Error << "STL Exception: " << e.what() << endl; + catch (const std::exception& e) { + SLOG(g_log << Logger::Error << "STL Exception: " << e.what() << endl, + g_slog->withName("startup")->error(Logr::Error, "STL Exception", e.what())); ret = EXIT_FAILURE; } catch (...) { - g_log << Logger::Error << "any other exception in main: " << endl; + SLOG(g_log << Logger::Error << "any other exception in main: " << endl, + g_slog->withName("startup")->error(Logr::Error, "Exception", "Unexpected")); ret = EXIT_FAILURE; }