OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/tools/crash_service/crash_service.h" | 5 #include "chrome/tools/crash_service/crash_service.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <tchar.h> | 9 #include <tchar.h> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 CommandLine::Init(0, NULL); | 40 CommandLine::Init(0, NULL); |
41 | 41 |
42 // We use/create a directory under the user's temp folder, for logging. | 42 // We use/create a directory under the user's temp folder, for logging. |
43 base::FilePath operating_dir; | 43 base::FilePath operating_dir; |
44 GetCrashServiceDirectory(&operating_dir); | 44 GetCrashServiceDirectory(&operating_dir); |
45 base::FilePath log_file = operating_dir.Append(kStandardLogFile); | 45 base::FilePath log_file = operating_dir.Append(kStandardLogFile); |
46 | 46 |
47 // Logging to stderr (to help with debugging failures on the | 47 // Logging to stderr (to help with debugging failures on the |
48 // buildbots) and to a file. | 48 // buildbots) and to a file. |
49 logging::InitLogging( | 49 logging::LoggingSettings settings; |
50 log_file.value().c_str(), | 50 settings.logging_dest = logging::LOG_TO_ALL; |
51 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG, | 51 settings.log_file = log_file.value().c_str(); |
52 logging::LOCK_LOG_FILE, | 52 logging::InitLogging(settings); |
53 logging::APPEND_TO_OLD_LOG_FILE, | |
54 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | |
55 // Logging with pid, tid and timestamp. | 53 // Logging with pid, tid and timestamp. |
56 logging::SetLogItems(true, true, true, false); | 54 logging::SetLogItems(true, true, true, false); |
57 | 55 |
58 VLOG(1) << "session start. cmdline is [" << cmd_line << "]"; | 56 VLOG(1) << "session start. cmdline is [" << cmd_line << "]"; |
59 | 57 |
60 CrashService crash_service(operating_dir.value()); | 58 CrashService crash_service(operating_dir.value()); |
61 if (!crash_service.Initialize(::GetCommandLineW())) | 59 if (!crash_service.Initialize(::GetCommandLineW())) |
62 return 1; | 60 return 1; |
63 | 61 |
64 VLOG(1) << "ready to process crash requests"; | 62 VLOG(1) << "ready to process crash requests"; |
65 | 63 |
66 // Enter the message loop. | 64 // Enter the message loop. |
67 int retv = crash_service.ProcessingLoop(); | 65 int retv = crash_service.ProcessingLoop(); |
68 // Time to exit. | 66 // Time to exit. |
69 VLOG(1) << "session end. return code is " << retv; | 67 VLOG(1) << "session end. return code is " << retv; |
70 return retv; | 68 return retv; |
71 } | 69 } |
OLD | NEW |