Skip to content

Commit bf7fcf3

Browse files
committed
Fix issues
Signed-off-by: JCW <[email protected]>
1 parent 013cbac commit bf7fcf3

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

include/xrpl/basics/Log.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class Logs
206206
write(
207207
beast::severities::Severity level,
208208
std::string const& partition,
209-
std::string text,
209+
std::string const& text,
210210
bool console);
211211

212212
std::string
@@ -244,7 +244,7 @@ class Logs
244244
static void
245245
format(
246246
std::string& output,
247-
std::string message,
247+
std::string const& message,
248248
beast::severities::Severity severity,
249249
std::string const& partition);
250250

include/xrpl/beast/utility/Journal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ enum Severity {
9797
kNone = kDisabled
9898
};
9999

100-
std::string
100+
std::string_view
101101
to_string(Severity severity);
102102
} // namespace severities
103103

src/libxrpl/basics/Log.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ void
200200
Logs::write(
201201
beast::severities::Severity level,
202202
std::string const& partition,
203-
std::string text,
203+
std::string const& text,
204204
bool console)
205205
{
206206
std::string s;
207-
format(s, std::move(text), level, partition);
207+
format(s, text, level, partition);
208208
file_.writeln(s);
209209
if (!silent_)
210210
std::cerr << s << '\n';
@@ -332,14 +332,14 @@ Logs::fromString(std::string const& s)
332332
void
333333
Logs::format(
334334
std::string& output,
335-
std::string message,
335+
std::string const& message,
336336
beast::severities::Severity severity,
337337
std::string const& partition)
338338
{
339-
output = std::move(message);
339+
output = message;
340340
if (!beast::Journal::isStructuredJournalEnabled())
341341
{
342-
output.reserve(message.size() + partition.size() + 100);
342+
output.reserve(output.size() + partition.size() + 100);
343343
output += to_string(std::chrono::system_clock::now());
344344

345345
output += " ";

src/libxrpl/beast/utility/beast_Journal.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Journal::getNullSink()
9898

9999
//------------------------------------------------------------------------------
100100

101-
std::string
101+
std::string_view
102102
severities::to_string(Severity severity)
103103
{
104104
switch (severity)
@@ -185,7 +185,7 @@ Journal::JsonLogContext::reset(
185185
value = threadIdStream.str();
186186
}
187187
};
188-
thread_local ThreadIdStringInitializer threadId;
188+
thread_local ThreadIdStringInitializer const threadId;
189189

190190
attributes_.SetObject();
191191
if (globalLogAttributes_.has_value())

0 commit comments

Comments
 (0)