MCPcopy Create free account
hub / github.com/apache/brpc / LogInfoToLogStr

Function LogInfoToLogStr

src/butil/logging.cc:560–571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560std::string LogInfoToLogStr(int severity, butil::StringPiece file,
561 int line, butil::StringPiece func,
562 butil::StringPiece content) {
563 // There's a copy here to concatenate prefix and content. Since
564 // DefaultLogSink is hardly used right now, the copy is irrelevant.
565 // A LogSink focused on performance should also be able to handle
566 // non-continuous inputs which is a must to maximize performance.
567 std::ostringstream os;
568 PrintLog(os, severity, file.data(), line, func.data(), content);
569 os << '\n';
570 return os.str();
571}
572
573std::string LogInfo2LogStr(const LogInfo& log_info) {
574 return LogInfoToLogStr(log_info.severity, log_info.file, log_info.line,

Callers 2

LogInfo2LogStrFunction · 0.85
OnLogMessageMethod · 0.85

Calls 2

PrintLogFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected