diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-27 08:58:19 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-27 08:58:19 +0000 |
commit | e81923ec188c6f90fc43c34eb634af2d9dab11d9 (patch) | |
tree | f908c5f991aaae5cedb4b55a705101b5cb000470 /content | |
parent | 14767bb56e1f92a0745fb0fe97b5ba6336d31691 (diff) | |
download | chromium_src-e81923ec188c6f90fc43c34eb634af2d9dab11d9.zip chromium_src-e81923ec188c6f90fc43c34eb634af2d9dab11d9.tar.gz chromium_src-e81923ec188c6f90fc43c34eb634af2d9dab11d9.tar.bz2 |
Don't log to stderr when running layout tests in the content shell
BUG=111316
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10636052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144420 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/shell/shell_main_delegate.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/content/shell/shell_main_delegate.cc b/content/shell/shell_main_delegate.cc index 05516c6..12cb139 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,23 @@ #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); + logging::SetLogItems(true, true, true, true); +} + +} // namespace + ShellMainDelegate::ShellMainDelegate() { } @@ -30,6 +49,8 @@ ShellMainDelegate::~ShellMainDelegate() { } bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) + InitLogging(); #if defined(OS_MACOSX) OverrideFrameworkBundlePath(); #endif |