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

Unified Diff: chrome/browser/chromeos/logging.cc

Issue 2909483003: Revert of Move RedirectChromeLogging to src/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/logging.h ('k') | chrome/browser/chromeos/login/session/user_session_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/logging.cc
diff --git a/chrome/browser/chromeos/logging.cc b/chrome/browser/chromeos/logging.cc
deleted file mode 100644
index b6d72e0358b18a97bed1c37d544a2ff5df14b2d1..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/logging.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/logging.h"
-
-#include "base/command_line.h"
-#include "base/files/file_path.h"
-#include "base/logging.h"
-#include "chrome/common/logging_chrome.h"
-
-namespace logging {
-
-void RedirectChromeLogging(const base::CommandLine& command_line) {
- // This should be true for exactly the period between the end of
- // InitChromeLogging() and the beginning of CleanupChromeLogging().
- static bool chrome_logging_redirected_ = false;
- if (chrome_logging_redirected_) {
- // TODO: Support multiple active users. http://crbug.com/230345
- LOG(WARNING) << "NOT redirecting logging for multi-profiles case.";
- return;
- }
-
- DCHECK(!chrome_logging_redirected_)
- << "Attempted to redirect logging when it was already initialized.";
-
- // Redirect logs to the session log directory, if set. Otherwise
- // defaults to the profile dir.
- const base::FilePath log_path = GetSessionLogFile(command_line);
-
- // Always force a new symlink when redirecting.
- const base::FilePath target_path = SetUpSymlinkIfNeeded(log_path, true);
-
- // ChromeOS always logs through the symlink, so it shouldn't be
- // deleted if it already exists.
- logging::LoggingSettings settings;
- settings.logging_dest = DetermineLoggingDestination(command_line);
- settings.log_file = log_path.value().c_str();
- if (!logging::InitLogging(settings)) {
- DLOG(ERROR) << "Unable to initialize logging to " << log_path.value();
- RemoveSymlinkAndLog(log_path, target_path);
- } else {
- chrome_logging_redirected_ = true;
- }
-}
-
-} // namespace logging
« no previous file with comments | « chrome/browser/chromeos/logging.h ('k') | chrome/browser/chromeos/login/session/user_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698