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 "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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 CloseLogFile(); | 243 CloseLogFile(); |
244 | 244 |
245 chrome_logging_initialized_ = false; | 245 chrome_logging_initialized_ = false; |
246 chrome_logging_redirected_ = false; | 246 chrome_logging_redirected_ = false; |
247 } | 247 } |
248 | 248 |
249 FilePath GetLogFileName() { | 249 FilePath GetLogFileName() { |
250 std::string filename; | 250 std::string filename; |
251 scoped_ptr<base::Environment> env(base::Environment::Create()); | 251 scoped_ptr<base::Environment> env(base::Environment::Create()); |
252 if (env->GetEnv(env_vars::kLogFileName, &filename) && !filename.empty()) { | 252 if (env->GetVar(env_vars::kLogFileName, &filename) && !filename.empty()) { |
253 #if defined(OS_WIN) | 253 #if defined(OS_WIN) |
254 return FilePath(UTF8ToWide(filename).c_str()); | 254 return FilePath(UTF8ToWide(filename).c_str()); |
255 #elif defined(OS_POSIX) | 255 #elif defined(OS_POSIX) |
256 return FilePath(filename.c_str()); | 256 return FilePath(filename.c_str()); |
257 #endif | 257 #endif |
258 } | 258 } |
259 | 259 |
260 const FilePath log_filename(FILE_PATH_LITERAL("chrome_debug.log")); | 260 const FilePath log_filename(FILE_PATH_LITERAL("chrome_debug.log")); |
261 FilePath log_path; | 261 FilePath log_path; |
262 | 262 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 assertions->push_back(wide_line); | 295 assertions->push_back(wide_line); |
296 ++assertion_count; | 296 ++assertion_count; |
297 } | 297 } |
298 } | 298 } |
299 log_file.close(); | 299 log_file.close(); |
300 | 300 |
301 return assertion_count; | 301 return assertion_count; |
302 } | 302 } |
303 | 303 |
304 } // namespace logging | 304 } // namespace logging |
OLD | NEW |