Skip to content

Commit 3c6fe58

Browse files
committed
Improve performance
Signed-off-by: JCW <[email protected]>
1 parent 6d85788 commit 3c6fe58

File tree

12 files changed

+294
-337
lines changed

12 files changed

+294
-337
lines changed

include/xrpl/basics/Log.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ class Logs
6868
operator=(Sink const&) = delete;
6969

7070
void
71-
write(beast::severities::Severity level, std::string&& text)
72-
override;
71+
write(beast::severities::Severity level, std::string&& text) override;
7372

7473
void
7574
writeAlways(beast::severities::Severity level, std::string&& text)
@@ -187,11 +186,19 @@ class Logs
187186
beast::Journal::Sink&
188187
operator[](std::string const& name);
189188

189+
template <typename AttributesFactory>
190190
beast::Journal
191-
journal(
192-
std::string const& name,
193-
std::optional<beast::Journal::JsonLogAttributes> attributes =
194-
std::nullopt);
191+
journal(std::string const& name, AttributesFactory&& factory)
192+
{
193+
return beast::Journal{
194+
get(name), name, std::forward<AttributesFactory>(factory)};
195+
}
196+
197+
beast::Journal
198+
journal(std::string const& name)
199+
{
200+
return beast::Journal{get(name), name};
201+
}
195202

196203
beast::severities::Severity
197204
threshold() const;

0 commit comments

Comments
 (0)