OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 19 matching lines...) Expand all Loading... |
30 // | 30 // |
31 // XXX | 31 // XXX |
32 // Setting suppress_error_dialogs to true disables any dialogs that would | 32 // Setting suppress_error_dialogs to true disables any dialogs that would |
33 // normally appear for assertions and crashes, and makes any catchable | 33 // normally appear for assertions and crashes, and makes any catchable |
34 // errors (namely assertions) available via GetSilencedErrorCount() | 34 // errors (namely assertions) available via GetSilencedErrorCount() |
35 // and GetSilencedError(). | 35 // and GetSilencedError(). |
36 void InitChromeLogging(const CommandLine& command_line, | 36 void InitChromeLogging(const CommandLine& command_line, |
37 OldFileDeletionState delete_old_log_file); | 37 OldFileDeletionState delete_old_log_file); |
38 | 38 |
39 #if defined(OS_CHROMEOS) | 39 #if defined(OS_CHROMEOS) |
40 void RedirectChromeLogging(const FilePath& new_log_dir, | 40 // Get the log file location. |
41 const CommandLine& command_line); | 41 FilePath GetSessionLogFile(const CommandLine& command_line); |
| 42 |
| 43 // Redirects chrome logging to the appropriate session log dir. |
| 44 void RedirectChromeLogging(const CommandLine& command_line); |
42 #endif | 45 #endif |
43 | 46 |
44 // Call when done using logging for Chrome. | 47 // Call when done using logging for Chrome. |
45 void CleanupChromeLogging(); | 48 void CleanupChromeLogging(); |
46 | 49 |
47 // Returns the fully-qualified name of the log file. | 50 // Returns the fully-qualified name of the log file. |
48 FilePath GetLogFileName(); | 51 FilePath GetLogFileName(); |
49 | 52 |
50 // Returns true when error/assertion dialogs are to be shown, | 53 // Returns true when error/assertion dialogs are to be shown, |
51 // false otherwise. | 54 // false otherwise. |
52 bool DialogsAreSuppressed(); | 55 bool DialogsAreSuppressed(); |
53 | 56 |
54 typedef std::vector<std::wstring> AssertionList; | 57 typedef std::vector<std::wstring> AssertionList; |
55 | 58 |
56 // Gets the list of fatal assertions in the current log file, and | 59 // Gets the list of fatal assertions in the current log file, and |
57 // returns the number of fatal assertions. (If you don't care | 60 // returns the number of fatal assertions. (If you don't care |
58 // about the actual list of assertions, you can pass in NULL.) | 61 // about the actual list of assertions, you can pass in NULL.) |
59 // NOTE: Since this reads the log file to determine the assertions, | 62 // NOTE: Since this reads the log file to determine the assertions, |
60 // this operation is O(n) over the length of the log. | 63 // this operation is O(n) over the length of the log. |
61 // NOTE: This can fail if the file is locked for writing. However, | 64 // NOTE: This can fail if the file is locked for writing. However, |
62 // this is unlikely as this function is most useful after | 65 // this is unlikely as this function is most useful after |
63 // the program writing the log has terminated. | 66 // the program writing the log has terminated. |
64 size_t GetFatalAssertions(AssertionList* assertions); | 67 size_t GetFatalAssertions(AssertionList* assertions); |
65 | 68 |
66 } // namespace logging | 69 } // namespace logging |
67 | 70 |
68 #endif // CHROME_COMMON_LOGGING_CHROME_H_ | 71 #endif // CHROME_COMMON_LOGGING_CHROME_H_ |
OLD | NEW |