StormByte C++ Library: Logger module 1.2.0
StormByte-Logger is the logging module of the StormByte C++ suite.
Loading...
Searching...
No Matches
typedefs.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte-Logger.
5 *
6 * StormByte-Logger is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License version 3
8 * or later, as published by the Free Software Foundation.
9 *
10 * StormByte-Logger is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with StormByte-Logger. If not, see
17 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
18 */
19
20#pragma once
21
23
24#include <string>
25
30namespace StormByte::Logger {
37 enum class STORMBYTE_LOGGER_PUBLIC Color : unsigned char {
38 Default,
39 Black,
40 Red,
41 Green,
42 Yellow,
43 Blue,
44 Magenta,
45 Cyan,
46 Gray,
47 White,
49 BrightRed,
56 };
57
66 enum class STORMBYTE_LOGGER_PUBLIC Level : unsigned short {
67 LowLevel = 0,
68 Debug,
69 Warning,
70 Notice,
71 Info,
72 Error,
73 Fatal
74 };
75
81 constexpr static std::string LevelToString(const Level& l) noexcept {
82 switch (l) {
83 case Level::LowLevel: return "LowLevel";
84 case Level::Debug: return "Debug";
85 case Level::Warning: return "Warning";
86 case Level::Notice: return "Notice";
87 case Level::Info: return "Info";
88 case Level::Error: return "Error";
89 case Level::Fatal: return "Fatal";
90 default: return "Error";
91 }
92 }
93}
Logger module of the StormByte suite.
static constexpr std::string LevelToString(const Level &l) noexcept
Convert a Level to a short name.
Definition typedefs.hxx:81
Level
Severity levels used by the logger.
Definition typedefs.hxx:66
@ Warning
Recoverable problems.
@ Notice
Significant normal events.
@ Info
Informational messages.
@ Fatal
Unrecoverable errors.
@ Error
Error conditions.
@ Debug
Debug information.
@ LowLevel
Verbose diagnostics.
Color
ANSI foreground colors supported by the logger.
Definition typedefs.hxx:37
@ Cyan
Standard cyan foreground.
@ White
Standard white foreground.
@ BrightBlue
Bright blue foreground.
@ BrightRed
Bright red foreground.
@ BrightWhite
Bright white foreground.
@ BrightMagenta
Bright magenta foreground.
@ Yellow
Standard yellow foreground.
@ Default
No ANSI sequence; preserve the terminal's current color.
@ BrightYellow
Bright yellow foreground.
@ BrightBlack
Bright black foreground.
@ Blue
Standard blue foreground.
@ Gray
Bright black/gray foreground.
@ BrightGreen
Bright green foreground.
@ Magenta
Standard magenta foreground.
@ BrightCyan
Bright cyan foreground.
@ Green
Standard green foreground.
@ Black
Standard black foreground.
@ Red
Standard red foreground.
#define STORMBYTE_LOGGER_PUBLIC
Definition visibility.h:28