From c2aae2d846672818fce23a13e4328492c2f8f546 Mon Sep 17 00:00:00 2001 From: JCW Date: Tue, 2 Sep 2025 19:41:26 +0100 Subject: [PATCH] Optimisation Signed-off-by: JCW --- include/xrpl/beast/utility/Journal.h | 8 -------- src/xrpld/app/main/Application.cpp | 23 ----------------------- src/xrpld/app/main/Application.h | 17 +++++++++++------ 3 files changed, 11 insertions(+), 37 deletions(-) diff --git a/include/xrpl/beast/utility/Journal.h b/include/xrpl/beast/utility/Journal.h index 0ea1f5e291..a335e23cfb 100644 --- a/include/xrpl/beast/utility/Journal.h +++ b/include/xrpl/beast/utility/Journal.h @@ -79,14 +79,6 @@ operator<<(std::ostream& os, LogParameter const& param); namespace beast { -// Forward declaration for use in interfaces -namespace detail { -class SimpleJsonWriter; -} - -// Type alias for journal attribute factory functions -using JournalAttributesFactory = void(detail::SimpleJsonWriter&); - namespace detail { class SimpleJsonWriter diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 82f86e789e..5351a90651 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -831,15 +831,6 @@ public: bool serverOkay(std::string& reason) override; - beast::Journal - journal( - std::string const& name, - std::function const& attributes) - override; - - beast::Journal - journal(std::string const& name) override; - //-------------------------------------------------------------------------- bool @@ -2175,20 +2166,6 @@ ApplicationImp::serverOkay(std::string& reason) return true; } -beast::Journal -ApplicationImp::journal( - std::string const& name, - std::function const& attributes) -{ - return logs_->journal(name, std::move(attributes)); -} - -beast::Journal -ApplicationImp::journal(std::string const& name) -{ - return logs_->journal(name); -} - void ApplicationImp::setMaxDisallowedLedger() { diff --git a/src/xrpld/app/main/Application.h b/src/xrpld/app/main/Application.h index 03926f27ea..474982bddf 100644 --- a/src/xrpld/app/main/Application.h +++ b/src/xrpld/app/main/Application.h @@ -257,13 +257,18 @@ public: virtual bool serverOkay(std::string& reason) = 0; - virtual beast::Journal - journal( - std::string const& name, - std::function const& attributes) = 0; + template + beast::Journal + journal(std::string const& name, TAttributesFactory&& factory) + { + return logs().journal(name, std::forward(factory)); + } - virtual beast::Journal - journal(std::string const& name) = 0; + beast::Journal + journal(std::string const& name) + { + return logs().journal(name); + } /* Returns the number of file descriptors the application needs */ virtual int