diff options
author | gspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 00:20:21 +0000 |
---|---|---|
committer | gspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 00:20:21 +0000 |
commit | c7d5da999d7320eff6826e4c18fce3f4a083b575 (patch) | |
tree | f41be2c85bfac03a86f6fd03da92720070c23d89 /base | |
parent | e913806556b5a09fe012a60d0be91b4ddea2443c (diff) | |
download | chromium_src-c7d5da999d7320eff6826e4c18fce3f4a083b575.zip chromium_src-c7d5da999d7320eff6826e4c18fce3f4a083b575.tar.gz chromium_src-c7d5da999d7320eff6826e4c18fce3f4a083b575.tar.bz2 |
This fixes the logging for ChromeOS so that it uses symlinks
to log to instead of going to the timestamped files directly, so that
the browser process can more precisely control the output file being
used. It still creates timestamped logs, and the regular chrome
operations should be unchanged.
Added a bool return value to InitLogging so we know when it fails,
because failing needs to be handled properly in ChromeOS to remove
hanging symbolic links.
[This change has already been reviewed and approved here:
http://codereview.chromium.org/3983004/show
Somehow the dcommit failed without me noticing, so I'm trying
again.]
BUG=http://crosbug.com/6343
TEST=ran on device in incognito and regular mode, looked at logs.
Review URL: http://codereview.chromium.org/4167004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64184 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/logging.cc | 6 | ||||
-rw-r--r-- | base/logging.h | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/base/logging.cc b/base/logging.cc index a6b52a7..e78b1a4 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -336,7 +336,7 @@ bool InitializeLogFileHandle() { return true; } -void BaseInitLoggingImpl(const PathChar* new_log_file, +bool BaseInitLoggingImpl(const PathChar* new_log_file, LoggingDestination logging_dest, LogLockingState lock_log, OldFileDeletionState delete_old) { @@ -370,7 +370,7 @@ void BaseInitLoggingImpl(const PathChar* new_log_file, // ignore file options if logging is disabled or only to system if (logging_destination == LOG_NONE || logging_destination == LOG_ONLY_TO_SYSTEM_DEBUG_LOG) - return; + return true; if (!log_file_name) log_file_name = new PathString(); @@ -378,7 +378,7 @@ void BaseInitLoggingImpl(const PathChar* new_log_file, if (delete_old == DELETE_OLD_LOG_FILE) DeleteFilePath(*log_file_name); - InitializeLogFileHandle(); + return InitializeLogFileHandle(); } void SetMinLogLevel(int level) { diff --git a/base/logging.h b/base/logging.h index 981669a..c4db4c5 100644 --- a/base/logging.h +++ b/base/logging.h @@ -179,7 +179,7 @@ typedef char PathChar; // Implementation of the InitLogging() method declared below. We use a // more-specific name so we can #define it above without affecting other code // that has named stuff "InitLogging". -void BaseInitLoggingImpl(const PathChar* log_file, +bool BaseInitLoggingImpl(const PathChar* log_file, LoggingDestination logging_dest, LogLockingState lock_log, OldFileDeletionState delete_old); @@ -194,11 +194,11 @@ void BaseInitLoggingImpl(const PathChar* log_file, // The default log file is initialized to "debug.log" in the application // directory. You probably don't want this, especially since the program // directory may not be writable on an enduser's system. -inline void InitLogging(const PathChar* log_file, +inline bool InitLogging(const PathChar* log_file, LoggingDestination logging_dest, LogLockingState lock_log, OldFileDeletionState delete_old) { - BaseInitLoggingImpl(log_file, logging_dest, lock_log, delete_old); + return BaseInitLoggingImpl(log_file, logging_dest, lock_log, delete_old); } // Sets the log level. Anything at or above this level will be written to the |