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
3 // found in the LICENSE file.
5 #ifndef CHROME_COMMON_LOGGING_CHROME_H__
6 #define CHROME_COMMON_LOGGING_CHROME_H__
8 #include "base/logging.h"
9 #include "base/time/time.h"
18 // Call to initialize logging for Chrome. This sets up the chrome-specific
19 // logfile naming scheme and might do other things like log modules and
20 // setting levels in the future.
22 // The main process might want to delete any old log files on startup by
23 // setting delete_old_log_file, but the renderer processes should not, or
24 // they will delete each others' logs.
27 // Setting suppress_error_dialogs to true disables any dialogs that would
28 // normally appear for assertions and crashes, and makes any catchable
29 // errors (namely assertions) available via GetSilencedErrorCount()
30 // and GetSilencedError().
31 void InitChromeLogging(const base::CommandLine
& command_line
,
32 OldFileDeletionState delete_old_log_file
);
34 #if defined(OS_CHROMEOS)
35 // Get the log file directory path.
36 base::FilePath
GetSessionLogDir(const base::CommandLine
& command_line
);
38 // Get the log file location.
39 base::FilePath
GetSessionLogFile(const base::CommandLine
& command_line
);
41 // Redirects chrome logging to the appropriate session log dir.
42 void RedirectChromeLogging(const base::CommandLine
& command_line
);
45 // Call when done using logging for Chrome.
46 void CleanupChromeLogging();
48 // Returns the fully-qualified name of the log file.
49 base::FilePath
GetLogFileName();
51 // Returns true when error/assertion dialogs are not to be shown, false
53 bool DialogsAreSuppressed();
55 // Inserts timestamp before file extension in the format
57 base::FilePath
GenerateTimestampedName(const base::FilePath
& base_path
,
58 base::Time timestamp
);
59 } // namespace logging
61 #endif // CHROME_COMMON_LOGGING_CHROME_H_