OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include "chrome/installer/util/logging_installer.h" | 7 #include "chrome/installer/util/logging_installer.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // Enable ETW logging. | 106 // Enable ETW logging. |
107 logging::LogEventProvider::Initialize(kSetupTraceProvider); | 107 logging::LogEventProvider::Initialize(kSetupTraceProvider); |
108 } | 108 } |
109 | 109 |
110 void EndInstallerLogging() { | 110 void EndInstallerLogging() { |
111 logging::CloseLogFile(); | 111 logging::CloseLogFile(); |
112 | 112 |
113 installer_logging_ = false; | 113 installer_logging_ = false; |
114 } | 114 } |
115 | 115 |
116 FilePath GetLogFilePath(const installer::MasterPreferences& prefs) { | 116 base::FilePath GetLogFilePath(const installer::MasterPreferences& prefs) { |
117 std::string path; | 117 std::string path; |
118 prefs.GetString(installer::master_preferences::kLogFile, &path); | 118 prefs.GetString(installer::master_preferences::kLogFile, &path); |
119 if (!path.empty()) { | 119 if (!path.empty()) { |
120 return base::FilePath(UTF8ToWide(path)); | 120 return base::FilePath(UTF8ToWide(path)); |
121 } | 121 } |
122 | 122 |
123 std::wstring log_filename = prefs.install_chrome_frame() ? | 123 std::wstring log_filename = prefs.install_chrome_frame() ? |
124 L"chrome_frame_installer.log" : L"chrome_installer.log"; | 124 L"chrome_frame_installer.log" : L"chrome_installer.log"; |
125 | 125 |
126 base::FilePath log_path; | 126 base::FilePath log_path; |
127 if (PathService::Get(base::DIR_TEMP, &log_path)) { | 127 if (PathService::Get(base::DIR_TEMP, &log_path)) { |
128 log_path = log_path.Append(log_filename); | 128 log_path = log_path.Append(log_filename); |
129 return log_path; | 129 return log_path; |
130 } else { | 130 } else { |
131 return base::FilePath(log_filename); | 131 return base::FilePath(log_filename); |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 } // namespace installer | 135 } // namespace installer |
OLD | NEW |