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

Unified Diff: content/shell/shell_main_delegate.cc

Issue 10636052: Don't log to stderr when running layout tests in the content shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_main_delegate.cc
diff --git a/content/shell/shell_main_delegate.cc b/content/shell/shell_main_delegate.cc
index 05516c60b46bcf31e8a2bfc8a22e0197eef3ef48..f894dca2f56cbf9e1f02bb59af394ff02b1bcab4 100644
--- a/content/shell/shell_main_delegate.cc
+++ b/content/shell/shell_main_delegate.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/file_path.h"
+#include "base/logging.h"
#include "base/path_service.h"
#include "content/public/browser/browser_main_runner.h"
#include "content/public/common/content_switches.h"
@@ -13,6 +14,7 @@
#include "content/shell/shell_browser_main.h"
#include "content/shell/shell_content_browser_client.h"
#include "content/shell/shell_content_renderer_client.h"
+#include "content/shell/shell_switches.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
@@ -20,6 +22,27 @@
#include "content/shell/paths_mac.h"
#endif // OS_MACOSX
+namespace {
+
+void InitLogging() {
+ FilePath log_filename;
+ PathService::Get(base::DIR_EXE, &log_filename);
+ log_filename = log_filename.AppendASCII("content_shell.log");
+ logging::InitLogging(
+ log_filename.value().c_str(),
+ logging::LOG_ONLY_TO_FILE,
+ logging::LOCK_LOG_FILE,
+ logging::DELETE_OLD_LOG_FILE,
+ logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
+ const bool kProcessId = true;
jam 2012/06/26 15:30:00 nit: i find that naming booleans like this, instea
+ const bool kThreadId = true;
+ const bool kTimestamp = true;
+ const bool kTickcount = true;
+ logging::SetLogItems(kProcessId, kThreadId, !kTimestamp, kTickcount);
+}
+
+} // namespace
+
ShellMainDelegate::ShellMainDelegate() {
}
@@ -30,6 +53,8 @@ ShellMainDelegate::~ShellMainDelegate() {
}
bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+ InitLogging();
#if defined(OS_MACOSX)
OverrideFrameworkBundlePath();
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698