• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
8 namespace fml {
9 
10 typedef int LogSeverity;
11 
12 // Default log levels. Negative values can be used for verbose log levels.
13 constexpr LogSeverity LOG_INFO = 0;
14 constexpr LogSeverity LOG_WARNING = 1;
15 constexpr LogSeverity LOG_ERROR = 2;
16 constexpr LogSeverity LOG_FATAL = 3;
17 constexpr 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
28 const LogSeverity LOG_DFATAL = LOG_ERROR;
29 #else
30 const LogSeverity LOG_DFATAL = LOG_FATAL;
31 #endif
32 
33 }  // namespace fml
34 
35 #endif  // FLUTTER_FML_LOG_LEVEL_H_
36