OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 SuppressDialogs(); | 118 SuppressDialogs(); |
119 | 119 |
120 std::wstring log_filter_prefix = | 120 std::wstring log_filter_prefix = |
121 command_line.GetSwitchValue(switches::kLogFilterPrefix); | 121 command_line.GetSwitchValue(switches::kLogFilterPrefix); |
122 logging::SetLogFilterPrefix(WideToUTF8(log_filter_prefix).c_str()); | 122 logging::SetLogFilterPrefix(WideToUTF8(log_filter_prefix).c_str()); |
123 | 123 |
124 // Use a minimum log level if the command line has one, otherwise set the | 124 // Use a minimum log level if the command line has one, otherwise set the |
125 // default to LOG_WARNING. | 125 // default to LOG_WARNING. |
126 std::wstring log_level = command_line.GetSwitchValue(switches::kLoggingLevel); | 126 std::wstring log_level = command_line.GetSwitchValue(switches::kLoggingLevel); |
127 int level = 0; | 127 int level = 0; |
128 if (StringToInt(log_level, &level)) { | 128 if (StringToInt(WideToUTF16Hack(log_level), &level)) { |
129 if ((level >= 0) && (level < LOG_NUM_SEVERITIES)) | 129 if ((level >= 0) && (level < LOG_NUM_SEVERITIES)) |
130 logging::SetMinLogLevel(level); | 130 logging::SetMinLogLevel(level); |
131 } else { | 131 } else { |
132 logging::SetMinLogLevel(LOG_WARNING); | 132 logging::SetMinLogLevel(LOG_WARNING); |
133 } | 133 } |
134 | 134 |
135 chrome_logging_initialized_ = true; | 135 chrome_logging_initialized_ = true; |
136 } | 136 } |
137 | 137 |
138 // This is a no-op, but we'll keep it around in case | 138 // This is a no-op, but we'll keep it around in case |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 assertions->push_back(wide_line); | 193 assertions->push_back(wide_line); |
194 ++assertion_count; | 194 ++assertion_count; |
195 } | 195 } |
196 } | 196 } |
197 log_file.close(); | 197 log_file.close(); |
198 | 198 |
199 return assertion_count; | 199 return assertion_count; |
200 } | 200 } |
201 | 201 |
202 } // namespace logging | 202 } // namespace logging |
203 | |
OLD | NEW |