| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 std::string profile_dir_str = chrome::kProfileDirPrefix; | 217 std::string profile_dir_str = chrome::kProfileDirPrefix; |
| 218 profile_dir_str.append(login_profile_value); | 218 profile_dir_str.append(login_profile_value); |
| 219 profile_dir = base::FilePath(profile_dir_str); | 219 profile_dir = base::FilePath(profile_dir_str); |
| 220 } | 220 } |
| 221 log_dir = log_dir.Append(profile_dir); | 221 log_dir = log_dir.Append(profile_dir); |
| 222 } | 222 } |
| 223 return log_dir.Append(GetLogFileName().BaseName()); | 223 return log_dir.Append(GetLogFileName().BaseName()); |
| 224 } | 224 } |
| 225 | 225 |
| 226 void RedirectChromeLogging(const CommandLine& command_line) { | 226 void RedirectChromeLogging(const CommandLine& command_line) { |
| 227 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles) && | 227 if (chrome_logging_redirected_) { |
| 228 chrome_logging_redirected_) { | |
| 229 // TODO(nkostylev): Support multiple active users. http://crbug.com/230345 | 228 // TODO(nkostylev): Support multiple active users. http://crbug.com/230345 |
| 230 LOG(ERROR) << "NOT redirecting logging for multi-profiles case."; | 229 LOG(WARNING) << "NOT redirecting logging for multi-profiles case."; |
| 231 return; | 230 return; |
| 232 } | 231 } |
| 233 | 232 |
| 234 DCHECK(!chrome_logging_redirected_) << | 233 DCHECK(!chrome_logging_redirected_) << |
| 235 "Attempted to redirect logging when it was already initialized."; | 234 "Attempted to redirect logging when it was already initialized."; |
| 236 | 235 |
| 237 // Redirect logs to the session log directory, if set. Otherwise | 236 // Redirect logs to the session log directory, if set. Otherwise |
| 238 // defaults to the profile dir. | 237 // defaults to the profile dir. |
| 239 base::FilePath log_path = GetSessionLogFile(command_line); | 238 base::FilePath log_path = GetSessionLogFile(command_line); |
| 240 | 239 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 time_deets.year, | 439 time_deets.year, |
| 441 time_deets.month, | 440 time_deets.month, |
| 442 time_deets.day_of_month, | 441 time_deets.day_of_month, |
| 443 time_deets.hour, | 442 time_deets.hour, |
| 444 time_deets.minute, | 443 time_deets.minute, |
| 445 time_deets.second); | 444 time_deets.second); |
| 446 return base_path.InsertBeforeExtensionASCII(suffix); | 445 return base_path.InsertBeforeExtensionASCII(suffix); |
| 447 } | 446 } |
| 448 | 447 |
| 449 } // namespace logging | 448 } // namespace logging |
| OLD | NEW |