1#ifndef SOURCEMETA_CORE_MCP_LOGGING_H_
2#define SOURCEMETA_CORE_MCP_LOGGING_H_
4#include <sourcemeta/core/json.h>
11namespace sourcemeta::core {
58[[nodiscard]]
constexpr auto
80#if !defined(__clang__)
102[[nodiscard]]
constexpr auto
104 -> std::optional<MCPLogLevel> {
105 constexpr std::array<MCPLogLevel, 8> LEVELS{
109 for (
const auto level : LEVELS) {
139[[nodiscard]]
constexpr auto
142 return level >= threshold;
std::basic_string_view< Char, CharTraits > StringView
The string view type used by the JSON document.
Definition json_value.h:54
constexpr auto mcp_log_level_enabled(const MCPLogLevel level, const MCPLogLevel threshold) noexcept -> bool
Definition mcp_logging.h:140
MCPLogLevel
Definition mcp_logging.h:26
constexpr auto mcp_log_level_string(const MCPLogLevel level) noexcept -> JSON::StringView
Definition mcp_logging.h:59
constexpr auto mcp_resolve_log_level(const JSON::StringView value) noexcept -> std::optional< MCPLogLevel >
Definition mcp_logging.h:103
@ Warning
Conditions that may require attention.
Definition mcp_logging.h:34
@ Notice
Normal but significant conditions.
Definition mcp_logging.h:32
@ Critical
Critical conditions.
Definition mcp_logging.h:38
@ Info
General informational messages.
Definition mcp_logging.h:30
@ Error
Error conditions.
Definition mcp_logging.h:36
@ Emergency
Conditions indicating that the system is unusable.
Definition mcp_logging.h:42
@ Debug
Detailed information useful for debugging.
Definition mcp_logging.h:28
@ Alert
Conditions requiring immediate action.
Definition mcp_logging.h:40