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 "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // they will delete each others' logs. | 25 // they will delete each others' logs. |
26 // | 26 // |
27 // XXX | 27 // XXX |
28 // Setting suppress_error_dialogs to true disables any dialogs that would | 28 // Setting suppress_error_dialogs to true disables any dialogs that would |
29 // normally appear for assertions and crashes, and makes any catchable | 29 // normally appear for assertions and crashes, and makes any catchable |
30 // errors (namely assertions) available via GetSilencedErrorCount() | 30 // errors (namely assertions) available via GetSilencedErrorCount() |
31 // and GetSilencedError(). | 31 // and GetSilencedError(). |
32 void InitChromeLogging(const base::CommandLine& command_line, | 32 void InitChromeLogging(const base::CommandLine& command_line, |
33 OldFileDeletionState delete_old_log_file); | 33 OldFileDeletionState delete_old_log_file); |
34 | 34 |
35 LoggingDestination DetermineLoggingDestination( | |
36 const base::CommandLine& command_line); | |
37 | |
38 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
39 // Point the logging symlink to the system log or the user session log. | |
40 base::FilePath SetUpSymlinkIfNeeded(const base::FilePath& symlink_path, | |
41 bool new_log); | |
42 | |
43 // Remove the logging symlink. | |
44 void RemoveSymlinkAndLog(const base::FilePath& link_path, | |
45 const base::FilePath& target_path); | |
46 | |
47 // Get the log file directory path. | 36 // Get the log file directory path. |
48 base::FilePath GetSessionLogDir(const base::CommandLine& command_line); | 37 base::FilePath GetSessionLogDir(const base::CommandLine& command_line); |
49 | 38 |
50 // Get the log file location. | 39 // Get the log file location. |
51 base::FilePath GetSessionLogFile(const base::CommandLine& command_line); | 40 base::FilePath GetSessionLogFile(const base::CommandLine& command_line); |
| 41 |
| 42 // Redirects chrome logging to the appropriate session log dir. |
| 43 void RedirectChromeLogging(const base::CommandLine& command_line); |
52 #endif | 44 #endif |
53 | 45 |
54 // Call when done using logging for Chrome. | 46 // Call when done using logging for Chrome. |
55 void CleanupChromeLogging(); | 47 void CleanupChromeLogging(); |
56 | 48 |
57 // Returns the fully-qualified name of the log file. | 49 // Returns the fully-qualified name of the log file. |
58 base::FilePath GetLogFileName(); | 50 base::FilePath GetLogFileName(); |
59 | 51 |
60 // Returns true when error/assertion dialogs are not to be shown, false | 52 // Returns true when error/assertion dialogs are not to be shown, false |
61 // otherwise. | 53 // otherwise. |
62 bool DialogsAreSuppressed(); | 54 bool DialogsAreSuppressed(); |
63 | 55 |
64 // Inserts timestamp before file extension in the format | 56 // Inserts timestamp before file extension in the format |
65 // "_yymmdd-hhmmss". | 57 // "_yymmdd-hhmmss". |
66 base::FilePath GenerateTimestampedName(const base::FilePath& base_path, | 58 base::FilePath GenerateTimestampedName(const base::FilePath& base_path, |
67 base::Time timestamp); | 59 base::Time timestamp); |
68 } // namespace logging | 60 } // namespace logging |
69 | 61 |
70 #endif // CHROME_COMMON_LOGGING_CHROME_H_ | 62 #endif // CHROME_COMMON_LOGGING_CHROME_H_ |
OLD | NEW |