blob: 58acda6723c445cee8b481211853b19cd1569b83 [file] [log] [blame]
[email protected]0f65b52d2012-02-09 21:02:471// Copyright (c) 2012 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commit09911bf2008-07-26 23:55:294
michaelpg33eea592017-01-19 01:34:565#ifndef CHROME_COMMON_LOGGING_CHROME_H_
6#define CHROME_COMMON_LOGGING_CHROME_H_
initial.commit09911bf2008-07-26 23:55:297
initial.commit09911bf2008-07-26 23:55:298#include "base/logging.h"
[email protected]3164fa822013-06-28 15:32:419#include "base/time/time.h"
avi2729e442015-12-26 05:27:4510#include "build/build_config.h"
initial.commit09911bf2008-07-26 23:55:2911
[email protected]a3ef4832013-02-02 05:12:3312namespace base {
[email protected]2f3b1cc2014-03-17 23:07:1513class CommandLine;
[email protected]73e23482009-08-13 00:26:5814class FilePath;
[email protected]a3ef4832013-02-02 05:12:3315}
initial.commit09911bf2008-07-26 23:55:2916
17namespace logging {
18
19// Call to initialize logging for Chrome. This sets up the chrome-specific
20// logfile naming scheme and might do other things like log modules and
21// setting levels in the future.
22//
23// The main process might want to delete any old log files on startup by
24// setting delete_old_log_file, but the renderer processes should not, or
25// they will delete each others' logs.
26//
27// XXX
28// Setting suppress_error_dialogs to true disables any dialogs that would
29// normally appear for assertions and crashes, and makes any catchable
30// errors (namely assertions) available via GetSilencedErrorCount()
31// and GetSilencedError().
[email protected]2f3b1cc2014-03-17 23:07:1532void InitChromeLogging(const base::CommandLine& command_line,
initial.commit09911bf2008-07-26 23:55:2933 OldFileDeletionState delete_old_log_file);
34
[email protected]77ee1b12010-06-14 16:21:3035#if defined(OS_CHROMEOS)
[email protected]cc5ff9852014-07-23 22:29:2936// Get the log file directory path.
37base::FilePath GetSessionLogDir(const base::CommandLine& command_line);
38
[email protected]0750b1442010-11-02 21:59:3739// Get the log file location.
[email protected]2f3b1cc2014-03-17 23:07:1540base::FilePath GetSessionLogFile(const base::CommandLine& command_line);
[email protected]0750b1442010-11-02 21:59:3741
42// Redirects chrome logging to the appropriate session log dir.
[email protected]2f3b1cc2014-03-17 23:07:1543void RedirectChromeLogging(const base::CommandLine& command_line);
[email protected]77ee1b12010-06-14 16:21:3044#endif
45
initial.commit09911bf2008-07-26 23:55:2946// Call when done using logging for Chrome.
47void CleanupChromeLogging();
48
49// Returns the fully-qualified name of the log file.
[email protected]a3ef4832013-02-02 05:12:3350base::FilePath GetLogFileName();
initial.commit09911bf2008-07-26 23:55:2951
erikwrightdfe29762015-03-16 16:06:4652// Returns true when error/assertion dialogs are not to be shown, false
53// otherwise.
initial.commit09911bf2008-07-26 23:55:2954bool DialogsAreSuppressed();
55
[email protected]395a0392012-04-12 15:35:0356// Inserts timestamp before file extension in the format
57// "_yymmdd-hhmmss".
[email protected]a3ef4832013-02-02 05:12:3358base::FilePath GenerateTimestampedName(const base::FilePath& base_path,
59 base::Time timestamp);
[email protected]e0ced0c72011-11-14 21:03:5060} // namespace logging
initial.commit09911bf2008-07-26 23:55:2961
[email protected]11f4857282009-11-13 19:56:1762#endif // CHROME_COMMON_LOGGING_CHROME_H_