Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(939)

Side by Side Diff: chrome/common/logging_chrome.cc

Issue 3056029: Move the number conversions from string_util to a new file.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/important_file_writer.cc ('k') | chrome/common/metrics_helpers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 // Need to include this before most other files because it defines 7 // Need to include this before most other files because it defines
8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define 8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define
9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the 9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the
10 // ViewMsgLog et al. functions. 10 // ViewMsgLog et al. functions.
(...skipping 20 matching lines...) Expand all
31 #include "chrome/common/logging_chrome.h" 31 #include "chrome/common/logging_chrome.h"
32 32
33 #include "base/command_line.h" 33 #include "base/command_line.h"
34 #include "base/compiler_specific.h" 34 #include "base/compiler_specific.h"
35 #include "base/debug_util.h" 35 #include "base/debug_util.h"
36 #include "base/env_var.h" 36 #include "base/env_var.h"
37 #include "base/file_path.h" 37 #include "base/file_path.h"
38 #include "base/file_util.h" 38 #include "base/file_util.h"
39 #include "base/logging.h" 39 #include "base/logging.h"
40 #include "base/path_service.h" 40 #include "base/path_service.h"
41 #include "base/string_number_conversions.h"
41 #include "base/string_util.h" 42 #include "base/string_util.h"
42 #include "base/time.h" 43 #include "base/time.h"
43 #include "base/utf_string_conversions.h" 44 #include "base/utf_string_conversions.h"
44 #include "chrome/common/chrome_paths.h" 45 #include "chrome/common/chrome_paths.h"
45 #include "chrome/common/chrome_switches.h" 46 #include "chrome/common/chrome_switches.h"
46 #include "chrome/common/env_vars.h" 47 #include "chrome/common/env_vars.h"
47 #include "ipc/ipc_logging.h" 48 #include "ipc/ipc_logging.h"
48 #if defined(OS_WIN) 49 #if defined(OS_WIN)
49 #include "base/logging_win.h" 50 #include "base/logging_win.h"
50 #include <initguid.h> 51 #include <initguid.h>
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 204
204 std::string log_filter_prefix = 205 std::string log_filter_prefix =
205 command_line.GetSwitchValueASCII(switches::kLogFilterPrefix); 206 command_line.GetSwitchValueASCII(switches::kLogFilterPrefix);
206 logging::SetLogFilterPrefix(log_filter_prefix.c_str()); 207 logging::SetLogFilterPrefix(log_filter_prefix.c_str());
207 208
208 // Use a minimum log level if the command line has one, otherwise set the 209 // Use a minimum log level if the command line has one, otherwise set the
209 // default to LOG_WARNING. 210 // default to LOG_WARNING.
210 std::string log_level = command_line.GetSwitchValueASCII( 211 std::string log_level = command_line.GetSwitchValueASCII(
211 switches::kLoggingLevel); 212 switches::kLoggingLevel);
212 int level = 0; 213 int level = 0;
213 if (StringToInt(log_level, &level)) { 214 if (base::StringToInt(log_level, &level)) {
214 if ((level >= 0) && (level < LOG_NUM_SEVERITIES)) 215 if ((level >= 0) && (level < LOG_NUM_SEVERITIES))
215 logging::SetMinLogLevel(level); 216 logging::SetMinLogLevel(level);
216 } else { 217 } else {
217 logging::SetMinLogLevel(LOG_WARNING); 218 logging::SetMinLogLevel(LOG_WARNING);
218 } 219 }
219 220
220 #if defined(OS_WIN) 221 #if defined(OS_WIN)
221 // Enable trace control and transport through event tracing for Windows. 222 // Enable trace control and transport through event tracing for Windows.
222 if (env->HasEnv(env_vars::kEtwLogging)) 223 if (env->HasEnv(env_vars::kEtwLogging))
223 logging::LogEventProvider::Initialize(kChromeTraceProviderName); 224 logging::LogEventProvider::Initialize(kChromeTraceProviderName);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 assertions->push_back(wide_line); 287 assertions->push_back(wide_line);
287 ++assertion_count; 288 ++assertion_count;
288 } 289 }
289 } 290 }
290 log_file.close(); 291 log_file.close();
291 292
292 return assertion_count; 293 return assertion_count;
293 } 294 }
294 295
295 } // namespace logging 296 } // namespace logging
OLDNEW
« no previous file with comments | « chrome/common/important_file_writer.cc ('k') | chrome/common/metrics_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698