1// Copyright 2013 The Flutter 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.
4
5#ifndef FLUTTER_FML_LOG_LEVEL_H_
6#define FLUTTER_FML_LOG_LEVEL_H_
7
8namespace fml {
9
10typedef int LogSeverity;
11
12// Default log levels. Negative values can be used for verbose log levels.
13constexpr LogSeverity LOG_INFO = 0;
14constexpr LogSeverity LOG_WARNING = 1;
15constexpr LogSeverity LOG_ERROR = 2;
16constexpr LogSeverity LOG_FATAL = 3;
17constexpr LogSeverity LOG_NUM_SEVERITIES = 4;
18
19// One of the Windows headers defines ERROR to 0. This makes the token
20// concatenation in FML_LOG(ERROR) to resolve to LOG_0. We define this back to
21// the appropriate log level.
22#ifdef _WIN32
23#define LOG_0 LOG_ERROR
24#endif
25
26// LOG_DFATAL is LOG_FATAL in debug mode, ERROR in normal mode
27#ifdef NDEBUG
28const LogSeverity LOG_DFATAL = LOG_ERROR;
29#else
30const LogSeverity LOG_DFATAL = LOG_FATAL;
31#endif
32
33} // namespace fml
34
35#endif // FLUTTER_FML_LOG_LEVEL_H_
36