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

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

Issue 2893313003: Add a switch to prevent logging redirection on chromeos. (Closed)
Patch Set: Created 3 years, 7 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
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 log_dir = log_dir.Append(profile_dir); 222 log_dir = log_dir.Append(profile_dir);
223 } 223 }
224 return log_dir; 224 return log_dir;
225 } 225 }
226 226
227 base::FilePath GetSessionLogFile(const base::CommandLine& command_line) { 227 base::FilePath GetSessionLogFile(const base::CommandLine& command_line) {
228 return GetSessionLogDir(command_line).Append(GetLogFileName().BaseName()); 228 return GetSessionLogDir(command_line).Append(GetLogFileName().BaseName());
229 } 229 }
230 230
231 void RedirectChromeLogging(const base::CommandLine& command_line) { 231 void RedirectChromeLogging(const base::CommandLine& command_line) {
sky 2017/05/23 17:35:31 AFAICT this function is only used in chromeos. Cod
achuithb 2017/05/25 19:36:41 Done.
232 if (command_line.HasSwitch(switches::kDisableLoggingRedirect))
233 return;
234
232 if (chrome_logging_redirected_) { 235 if (chrome_logging_redirected_) {
233 // TODO(nkostylev): Support multiple active users. http://crbug.com/230345 236 // TODO(nkostylev): Support multiple active users. http://crbug.com/230345
234 LOG(WARNING) << "NOT redirecting logging for multi-profiles case."; 237 LOG(WARNING) << "NOT redirecting logging for multi-profiles case.";
235 return; 238 return;
236 } 239 }
237 240
238 DCHECK(!chrome_logging_redirected_) << 241 DCHECK(!chrome_logging_redirected_) <<
239 "Attempted to redirect logging when it was already initialized."; 242 "Attempted to redirect logging when it was already initialized.";
240 243
241 // Redirect logs to the session log directory, if set. Otherwise 244 // Redirect logs to the session log directory, if set. Otherwise
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 time_deets.year, 425 time_deets.year,
423 time_deets.month, 426 time_deets.month,
424 time_deets.day_of_month, 427 time_deets.day_of_month,
425 time_deets.hour, 428 time_deets.hour,
426 time_deets.minute, 429 time_deets.minute,
427 time_deets.second); 430 time_deets.second);
428 return base_path.InsertBeforeExtensionASCII(suffix); 431 return base_path.InsertBeforeExtensionASCII(suffix);
429 } 432 }
430 433
431 } // namespace logging 434 } // namespace logging
OLDNEW
« chrome/common/chrome_switches.h ('K') | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698