File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ class Logs
206
206
write (
207
207
beast::severities::Severity level,
208
208
std::string const & partition,
209
- std::string text,
209
+ std::string const & text,
210
210
bool console);
211
211
212
212
std::string
@@ -244,7 +244,7 @@ class Logs
244
244
static void
245
245
format (
246
246
std::string& output,
247
- std::string message,
247
+ std::string const & message,
248
248
beast::severities::Severity severity,
249
249
std::string const & partition);
250
250
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ enum Severity {
97
97
kNone = kDisabled
98
98
};
99
99
100
- std::string
100
+ std::string_view
101
101
to_string (Severity severity);
102
102
} // namespace severities
103
103
Original file line number Diff line number Diff line change @@ -200,11 +200,11 @@ void
200
200
Logs::write (
201
201
beast::severities::Severity level,
202
202
std::string const & partition,
203
- std::string text,
203
+ std::string const & text,
204
204
bool console)
205
205
{
206
206
std::string s;
207
- format (s, std::move ( text) , level, partition);
207
+ format (s, text, level, partition);
208
208
file_.writeln (s);
209
209
if (!silent_)
210
210
std::cerr << s << ' \n ' ;
@@ -332,14 +332,14 @@ Logs::fromString(std::string const& s)
332
332
void
333
333
Logs::format (
334
334
std::string& output,
335
- std::string message,
335
+ std::string const & message,
336
336
beast::severities::Severity severity,
337
337
std::string const & partition)
338
338
{
339
- output = std::move ( message) ;
339
+ output = message;
340
340
if (!beast::Journal::isStructuredJournalEnabled ())
341
341
{
342
- output.reserve (message .size () + partition.size () + 100 );
342
+ output.reserve (output .size () + partition.size () + 100 );
343
343
output += to_string (std::chrono::system_clock::now ());
344
344
345
345
output += " " ;
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ Journal::getNullSink()
98
98
99
99
// ------------------------------------------------------------------------------
100
100
101
- std::string
101
+ std::string_view
102
102
severities::to_string (Severity severity)
103
103
{
104
104
switch (severity)
@@ -185,7 +185,7 @@ Journal::JsonLogContext::reset(
185
185
value = threadIdStream.str ();
186
186
}
187
187
};
188
- thread_local ThreadIdStringInitializer threadId;
188
+ thread_local ThreadIdStringInitializer const threadId;
189
189
190
190
attributes_.SetObject ();
191
191
if (globalLogAttributes_.has_value ())
You can’t perform that action at this time.
0 commit comments