| 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 #ifndef CHROME_COMMON_LOGGING_CHROME_H__ | 5 #ifndef CHROME_COMMON_LOGGING_CHROME_H__ |
| 6 #define CHROME_COMMON_LOGGING_CHROME_H__ | 6 #define CHROME_COMMON_LOGGING_CHROME_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 | 13 |
| 14 namespace base { |
| 14 class CommandLine; | 15 class CommandLine; |
| 15 | |
| 16 namespace base { | |
| 17 class FilePath; | 16 class FilePath; |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace logging { | 19 namespace logging { |
| 21 | 20 |
| 22 // Call to initialize logging for Chrome. This sets up the chrome-specific | 21 // Call to initialize logging for Chrome. This sets up the chrome-specific |
| 23 // logfile naming scheme and might do other things like log modules and | 22 // logfile naming scheme and might do other things like log modules and |
| 24 // setting levels in the future. | 23 // setting levels in the future. |
| 25 // | 24 // |
| 26 // The main process might want to delete any old log files on startup by | 25 // The main process might want to delete any old log files on startup by |
| 27 // setting delete_old_log_file, but the renderer processes should not, or | 26 // setting delete_old_log_file, but the renderer processes should not, or |
| 28 // they will delete each others' logs. | 27 // they will delete each others' logs. |
| 29 // | 28 // |
| 30 // XXX | 29 // XXX |
| 31 // Setting suppress_error_dialogs to true disables any dialogs that would | 30 // Setting suppress_error_dialogs to true disables any dialogs that would |
| 32 // normally appear for assertions and crashes, and makes any catchable | 31 // normally appear for assertions and crashes, and makes any catchable |
| 33 // errors (namely assertions) available via GetSilencedErrorCount() | 32 // errors (namely assertions) available via GetSilencedErrorCount() |
| 34 // and GetSilencedError(). | 33 // and GetSilencedError(). |
| 35 void InitChromeLogging(const CommandLine& command_line, | 34 void InitChromeLogging(const base::CommandLine& command_line, |
| 36 OldFileDeletionState delete_old_log_file); | 35 OldFileDeletionState delete_old_log_file); |
| 37 | 36 |
| 38 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
| 39 // Get the log file location. | 38 // Get the log file location. |
| 40 base::FilePath GetSessionLogFile(const CommandLine& command_line); | 39 base::FilePath GetSessionLogFile(const base::CommandLine& command_line); |
| 41 | 40 |
| 42 // Redirects chrome logging to the appropriate session log dir. | 41 // Redirects chrome logging to the appropriate session log dir. |
| 43 void RedirectChromeLogging(const CommandLine& command_line); | 42 void RedirectChromeLogging(const base::CommandLine& command_line); |
| 44 #endif | 43 #endif |
| 45 | 44 |
| 46 // Call when done using logging for Chrome. | 45 // Call when done using logging for Chrome. |
| 47 void CleanupChromeLogging(); | 46 void CleanupChromeLogging(); |
| 48 | 47 |
| 49 // Returns the fully-qualified name of the log file. | 48 // Returns the fully-qualified name of the log file. |
| 50 base::FilePath GetLogFileName(); | 49 base::FilePath GetLogFileName(); |
| 51 | 50 |
| 52 // Returns true when error/assertion dialogs are to be shown, | 51 // Returns true when error/assertion dialogs are to be shown, |
| 53 // false otherwise. | 52 // false otherwise. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 65 // the program writing the log has terminated. | 64 // the program writing the log has terminated. |
| 66 size_t GetFatalAssertions(AssertionList* assertions); | 65 size_t GetFatalAssertions(AssertionList* assertions); |
| 67 | 66 |
| 68 // Inserts timestamp before file extension in the format | 67 // Inserts timestamp before file extension in the format |
| 69 // "_yymmdd-hhmmss". | 68 // "_yymmdd-hhmmss". |
| 70 base::FilePath GenerateTimestampedName(const base::FilePath& base_path, | 69 base::FilePath GenerateTimestampedName(const base::FilePath& base_path, |
| 71 base::Time timestamp); | 70 base::Time timestamp); |
| 72 } // namespace logging | 71 } // namespace logging |
| 73 | 72 |
| 74 #endif // CHROME_COMMON_LOGGING_CHROME_H_ | 73 #endif // CHROME_COMMON_LOGGING_CHROME_H_ |
| OLD | NEW |