Chromium Code Reviews| 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 |