Commit e1a69127 authored by Saman's avatar Saman Committed by Commit Bot

[fuchsia] Use the with_source variant of fx_logger_log

fx_logger_log_with_source() takes file and line as parameters
and lets the syslog library handle them.

Change-Id: I15b3b7948e8ad48781ac36afa6fa9df2145da5a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521365
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824898}
parent f82d48ed
...@@ -799,10 +799,8 @@ LogMessage::~LogMessage() { ...@@ -799,10 +799,8 @@ LogMessage::~LogMessage() {
// Temporarily remove the trailing newline from |str_newline|'s C-string // Temporarily remove the trailing newline from |str_newline|'s C-string
// representation, since fx_logger will add a newline of its own. // representation, since fx_logger will add a newline of its own.
str_newline.pop_back(); str_newline.pop_back();
std::string message = fx_logger_log_with_source(logger, severity, nullptr, file_, line_,
base::StringPrintf("%s(%d) %s", file_basename_, line_, str_newline.c_str() + message_start_);
str_newline.c_str() + message_start_);
fx_logger_log(logger, severity, nullptr, message.data());
str_newline.push_back('\n'); str_newline.push_back('\n');
} }
#endif // OS_FUCHSIA #endif // OS_FUCHSIA
......
...@@ -184,8 +184,8 @@ TEST_F(WebEngineIntegrationLoggingTest, SetJavaScriptLogLevel_DEBUG) { ...@@ -184,8 +184,8 @@ TEST_F(WebEngineIntegrationLoggingTest, SetJavaScriptLogLevel_DEBUG) {
ASSERT_EQ(logged_message_.tags.size(), 1u); ASSERT_EQ(logged_message_.tags.size(), 1u);
EXPECT_EQ(logged_message_.tags[0], kWebEngineLogTag); EXPECT_EQ(logged_message_.tags[0], kWebEngineLogTag);
EXPECT_EQ(NormalizeConsoleLogMessage(logged_message_.msg), EXPECT_EQ(NormalizeConsoleLogMessage(logged_message_.msg),
"frame_impl.cc(" + std::string(kNormalizedLineNumber) + "[frame_impl.cc(" + std::string(kNormalizedLineNumber) +
") debug:http://127.0.0.1:" + kNormalizedPortNumber + ")] debug:http://127.0.0.1:" + kNormalizedPortNumber +
"/console_logging.html:8 " "/console_logging.html:8 "
": This is a debug() message."); ": This is a debug() message.");
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment