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

Unified Diff: media/mojo/services/mojo_media_application.cc

Issue 823853003: Enable logging in mojo:media app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | mojo/services/html_viewer/html_viewer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_media_application.cc
diff --git a/media/mojo/services/mojo_media_application.cc b/media/mojo/services/mojo_media_application.cc
index 2ab217ce345603b4e82aaa9286dd512a7d66d9a3..a6b0b52a110bf919014cdd1e2ee44c90b163a015 100644
--- a/media/mojo/services/mojo_media_application.cc
+++ b/media/mojo/services/mojo_media_application.cc
@@ -2,11 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/command_line.h"
+#include "base/logging.h"
#include "media/mojo/services/mojo_renderer_service.h"
#include "mojo/application/application_runner_chromium.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/interface_factory_impl.h"
namespace media {
@@ -16,6 +19,25 @@ class MojoMediaApplication
public mojo::InterfaceFactory<mojo::MediaRenderer> {
public:
// mojo::ApplicationDelegate implementation.
+ void Initialize(mojo::ApplicationImpl* app) override {
+ base::CommandLine::StringVector command_line_args;
+#if defined(OS_WIN)
+ for (const auto& arg : app->args())
+ command_line_args.push_back(base::UTF8ToUTF16(arg));
+#elif defined(OS_POSIX)
+ command_line_args = app->args();
+#endif
+
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ command_line->InitFromArgv(command_line_args);
+
+ logging::LoggingSettings settings;
+ settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
+ logging::InitLogging(settings);
+ // Display process ID, thread ID and timestamp in logs.
+ logging::SetLogItems(true, true, true, false);
+ }
+
bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) override {
connection->AddService(this);
« no previous file with comments | « no previous file | mojo/services/html_viewer/html_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698