| 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_util.h" | 10 #include "base/file_util.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 bool value = false; | 83 bool value = false; |
| 84 if (prefs.GetBool(installer::master_preferences::kDisableLogging, | 84 if (prefs.GetBool(installer::master_preferences::kDisableLogging, |
| 85 &value) && value) { | 85 &value) && value) { |
| 86 return; | 86 return; |
| 87 } | 87 } |
| 88 | 88 |
| 89 base::FilePath log_file_path(GetLogFilePath(prefs)); | 89 base::FilePath log_file_path(GetLogFilePath(prefs)); |
| 90 TruncateLogFileIfNeeded(log_file_path); | 90 TruncateLogFileIfNeeded(log_file_path); |
| 91 | 91 |
| 92 logging::InitLogging( | 92 logging::LoggingSettings settings; |
| 93 log_file_path.value().c_str(), | 93 settings.logging_dest = logging::LOG_TO_FILE; |
| 94 logging::LOG_ONLY_TO_FILE, | 94 settings.log_file = log_file_path.value().c_str(); |
| 95 logging::LOCK_LOG_FILE, | 95 logging::InitLogging(settings); |
| 96 logging::APPEND_TO_OLD_LOG_FILE, | |
| 97 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | |
| 98 | 96 |
| 99 if (prefs.GetBool(installer::master_preferences::kVerboseLogging, | 97 if (prefs.GetBool(installer::master_preferences::kVerboseLogging, |
| 100 &value) && value) { | 98 &value) && value) { |
| 101 logging::SetMinLogLevel(logging::LOG_VERBOSE); | 99 logging::SetMinLogLevel(logging::LOG_VERBOSE); |
| 102 } else { | 100 } else { |
| 103 logging::SetMinLogLevel(logging::LOG_ERROR); | 101 logging::SetMinLogLevel(logging::LOG_ERROR); |
| 104 } | 102 } |
| 105 | 103 |
| 106 // Enable ETW logging. | 104 // Enable ETW logging. |
| 107 logging::LogEventProvider::Initialize(kSetupTraceProvider); | 105 logging::LogEventProvider::Initialize(kSetupTraceProvider); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 126 base::FilePath log_path; | 124 base::FilePath log_path; |
| 127 if (PathService::Get(base::DIR_TEMP, &log_path)) { | 125 if (PathService::Get(base::DIR_TEMP, &log_path)) { |
| 128 log_path = log_path.Append(log_filename); | 126 log_path = log_path.Append(log_filename); |
| 129 return log_path; | 127 return log_path; |
| 130 } else { | 128 } else { |
| 131 return base::FilePath(log_filename); | 129 return base::FilePath(log_filename); |
| 132 } | 130 } |
| 133 } | 131 } |
| 134 | 132 |
| 135 } // namespace installer | 133 } // namespace installer |
| OLD | NEW |