blob: 8dacb52b405aaa90976a758fa1ba4f02af2d8e34 [file] [log] [blame] [edit]
// Copyright 2016 The Fuchsia 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 LIB_SYSLOG_CPP_LOG_LEVEL_H_
#define LIB_SYSLOG_CPP_LOG_LEVEL_H_
#include <cstdint>
// REVIEWERS: DO NOT +2 any changes to this header
// file unless this number is incremented with each change.
#define FX_LOG_INTREE_API_VERSION (0)
namespace syslog {
typedef int8_t LogSeverity;
// Default log levels.
constexpr LogSeverity LOG_TRACE = 0x10;
constexpr LogSeverity LOG_DEBUG = 0x20;
constexpr LogSeverity LOG_INFO = 0x30;
constexpr LogSeverity LOG_WARNING = 0x40;
constexpr LogSeverity LOG_ERROR = 0x50;
constexpr LogSeverity LOG_FATAL = 0x60;
constexpr LogSeverity LOG_NONE = 0x7F;
constexpr LogSeverity DefaultLogLevel = LOG_INFO;
constexpr int LogSeverityStepSize = 0x10;
constexpr int LogVerbosityStepSize = 0x1;
// LOG_DFATAL is LOG_FATAL in debug mode, LOG_ERROR in normal mode
#ifdef NDEBUG
const LogSeverity LOG_DFATAL = LOG_ERROR;
#else
const LogSeverity LOG_DFATAL = LOG_FATAL;
#endif
inline LogSeverity LOG_LEVEL(int8_t level) { return level; }
} // namespace syslog
#endif // LIB_SYSLOG_CPP_LOG_LEVEL_H_