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

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

Issue 14139003: Chrome OS multi-profiles backend and UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
OLDNEW
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } else { 209 } else {
210 PathService::Get(chrome::DIR_USER_DATA, &log_dir); 210 PathService::Get(chrome::DIR_USER_DATA, &log_dir);
211 base::FilePath login_profile = 211 base::FilePath login_profile =
212 command_line.GetSwitchValuePath(chromeos::switches::kLoginProfile); 212 command_line.GetSwitchValuePath(chromeos::switches::kLoginProfile);
213 log_dir = log_dir.Append(login_profile); 213 log_dir = log_dir.Append(login_profile);
214 } 214 }
215 return log_dir.Append(GetLogFileName().BaseName()); 215 return log_dir.Append(GetLogFileName().BaseName());
216 } 216 }
217 217
218 void RedirectChromeLogging(const CommandLine& command_line) { 218 void RedirectChromeLogging(const CommandLine& command_line) {
219 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles) &&
220 chrome_logging_redirected_) {
221 // TODO(nkostylev): Support multiple active users.
222 LOG(ERROR) << "NOT redirecting logging for multi-profiles case.";
223 return;
224 }
225
219 DCHECK(!chrome_logging_redirected_) << 226 DCHECK(!chrome_logging_redirected_) <<
220 "Attempted to redirect logging when it was already initialized."; 227 "Attempted to redirect logging when it was already initialized.";
221 228
222 // Redirect logs to the session log directory, if set. Otherwise 229 // Redirect logs to the session log directory, if set. Otherwise
223 // defaults to the profile dir. 230 // defaults to the profile dir.
224 base::FilePath log_path = GetSessionLogFile(command_line); 231 base::FilePath log_path = GetSessionLogFile(command_line);
225 232
226 // Creating symlink causes us to do blocking IO on UI thread. 233 // Creating symlink causes us to do blocking IO on UI thread.
227 // Temporarily allow it until we fix http://crbug.com/61143 234 // Temporarily allow it until we fix http://crbug.com/61143
228 base::ThreadRestrictions::ScopedAllowIO allow_io; 235 base::ThreadRestrictions::ScopedAllowIO allow_io;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 time_deets.year, 452 time_deets.year,
446 time_deets.month, 453 time_deets.month,
447 time_deets.day_of_month, 454 time_deets.day_of_month,
448 time_deets.hour, 455 time_deets.hour,
449 time_deets.minute, 456 time_deets.minute,
450 time_deets.second); 457 time_deets.second);
451 return base_path.InsertBeforeExtensionASCII(suffix); 458 return base_path.InsertBeforeExtensionASCII(suffix);
452 } 459 }
453 460
454 } // namespace logging 461 } // namespace logging
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698