Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/webrtc_overrides/webrtc/base/logging.cc

Issue 1982643002: Fix backwards WebRTC-in-Chromium override and expose Chromium logging setup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ...and expose it even if !defined(LOGGING_INSIDE_WEBRTC) Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/webrtc_overrides/webrtc/base/logging.cc
diff --git a/third_party/webrtc_overrides/webrtc/base/logging.cc b/third_party/webrtc_overrides/webrtc/base/logging.cc
index db888c1a4ad2c43c0cb526d3859dbab90ee43a01..855ae6bf489f548e6c203f2258c325cb862b39fb 100644
--- a/third_party/webrtc_overrides/webrtc/base/logging.cc
+++ b/third_party/webrtc_overrides/webrtc/base/logging.cc
@@ -13,8 +13,10 @@
#include <algorithm>
#include <iomanip>
+#include <string>
#include "base/atomicops.h"
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/threading/platform_thread.h"
@@ -49,6 +51,16 @@ static_assert(sizeof(base::subtle::Atomic32) == sizeof(base::PlatformThreadId),
base::subtle::Atomic32 g_init_logging_delegate_thread_id = 0;
#endif
+void InitChromiumLoggingAndCommandLine() {
+ // 0 means no arguments, so the null argv is never touched
+ base::CommandLine::Init(0, nullptr);
+
+ // Chromium checks for the presence of --v when deciding log level.
+ // Note that the *value* of --v doesn't matter for this check.
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII("v", "");
+ logging::InitLogging(logging::LoggingSettings());
+}
+
/////////////////////////////////////////////////////////////////////////////
// Constant Labels
/////////////////////////////////////////////////////////////////////////////
@@ -201,8 +213,8 @@ DiagnosticLogMessage::~DiagnosticLogMessage() {
}
// static
-void LogMessage::LogToDebug(int min_sev) {
- logging::SetMinLogLevel(min_sev);
+void LogMessage::LogToDebug(LoggingSeverity min_sev) {
+ logging::SetMinLogLevel(WebRtcSevToChromeSev(min_sev));
Henrik Grunell 2016/05/18 08:43:26 Yes, this was indeed wrong. Great to have it fixed
}
// Note: this function is a copy from the overriden libjingle implementation.

Powered by Google App Engine
This is Rietveld 408576698