mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
More work towards https://github.com/flutter/flutter/issues/134969. I decided not to touch the `LOG_X` variables since they are just used in macro expansion.
61 lines
2.0 KiB
C++
61 lines
2.0 KiB
C++
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef FLUTTER_FML_LOG_LEVEL_H_
|
|
#define FLUTTER_FML_LOG_LEVEL_H_
|
|
|
|
namespace fml {
|
|
|
|
// Default log levels. Negative values can be used for verbose log levels.
|
|
typedef int LogSeverity;
|
|
|
|
constexpr LogSeverity kLogInfo = 0;
|
|
constexpr LogSeverity kLogWarning = 1;
|
|
constexpr LogSeverity kLogError = 2;
|
|
constexpr LogSeverity kLogFatal = 3;
|
|
constexpr LogSeverity kLogNumSeverities = 4;
|
|
|
|
// DEPRECATED: Use |kLogInfo|.
|
|
// Ignoring Clang Tidy because this is used in a very common substitution macro.
|
|
// NOLINTNEXTLINE(readability-identifier-naming)
|
|
constexpr LogSeverity LOG_INFO = kLogInfo;
|
|
|
|
// DEPRECATED: Use |kLogWarning|.
|
|
// Ignoring Clang Tidy because this is used in a very common substitution macro.
|
|
// NOLINTNEXTLINE(readability-identifier-naming)
|
|
constexpr LogSeverity LOG_WARNING = kLogWarning;
|
|
|
|
// DEPRECATED: Use |kLogError|.
|
|
// Ignoring Clang Tidy because this is used in a very common substitution macro.
|
|
// NOLINTNEXTLINE(readability-identifier-naming)
|
|
constexpr LogSeverity LOG_ERROR = kLogError;
|
|
|
|
// DEPRECATED: Use |kLogFatal|.
|
|
// Ignoring Clang Tidy because this is used in a very common substitution macro.
|
|
// NOLINTNEXTLINE(readability-identifier-naming)
|
|
constexpr LogSeverity LOG_FATAL = kLogFatal;
|
|
|
|
// One of the Windows headers defines ERROR to 0. This makes the token
|
|
// concatenation in FML_LOG(ERROR) to resolve to LOG_0. We define this back to
|
|
// the appropriate log level.
|
|
#ifdef _WIN32
|
|
#define LOG_0 kLogError
|
|
#endif
|
|
|
|
// kLogDFatal is kLogFatal in debug mode, kLogError in normal mode
|
|
#ifdef NDEBUG
|
|
const LogSeverity kLogDFatal = kLogError;
|
|
#else
|
|
const LogSeverity kLogDFatal = kLogFatal;
|
|
#endif
|
|
|
|
// DEPRECATED: Use |kLogDFatal|.
|
|
// Ignoring Clang Tidy because this is used in a very common substitution macro.
|
|
// NOLINTNEXTLINE(readability-identifier-naming)
|
|
const LogSeverity LOG_DFATAL = kLogDFatal;
|
|
|
|
} // namespace fml
|
|
|
|
#endif // FLUTTER_FML_LOG_LEVEL_H_
|