• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2024 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef BASE_LOGGING_LOG_SEVERITY_H_
6 #define BASE_LOGGING_LOG_SEVERITY_H_
7 
8 #include "base/dcheck_is_on.h"
9 
10 namespace logging {
11 
12 using LogSeverity = int;
13 
14 inline constexpr LogSeverity LOGGING_VERBOSE = -1;  // This is level 1 verbosity
15 // Note: the log severities are used to index into the array of names,
16 // see log_severity_names.
17 inline constexpr LogSeverity LOGGING_INFO = 0;
18 inline constexpr LogSeverity LOGGING_WARNING = 1;
19 inline constexpr LogSeverity LOGGING_ERROR = 2;
20 inline constexpr LogSeverity LOGGING_FATAL = 3;
21 inline constexpr LogSeverity LOGGING_NUM_SEVERITIES = 4;
22 
23 // LOGGING_DFATAL is LOGGING_FATAL in DCHECK-enabled builds, ERROR in normal
24 // mode.
25 #if DCHECK_IS_ON()
26 inline constexpr LogSeverity LOGGING_DFATAL = LOGGING_FATAL;
27 #else
28 inline constexpr LogSeverity LOGGING_DFATAL = LOGGING_ERROR;
29 #endif
30 
31 }  // namespace logging
32 
33 #endif  // BASE_LOGGING_LOG_SEVERITY_H_
34