blob: 36150551dc01e05f45b84aee10c004fbafb0c18b [file] [log] [blame]
Lukasz Anforowicz191a4d32024-11-12 01:48:081// 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
10namespace logging {
11
12using LogSeverity = int;
13
14inline 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.
17inline constexpr LogSeverity LOGGING_INFO = 0;
18inline constexpr LogSeverity LOGGING_WARNING = 1;
19inline constexpr LogSeverity LOGGING_ERROR = 2;
20inline constexpr LogSeverity LOGGING_FATAL = 3;
21inline 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()
26inline constexpr LogSeverity LOGGING_DFATAL = LOGGING_FATAL;
27#else
28inline constexpr LogSeverity LOGGING_DFATAL = LOGGING_ERROR;
29#endif
30
31} // namespace logging
32
33#endif // BASE_LOGGING_LOG_SEVERITY_H_