|
ReXGlue SDK
|
Classes | |
| struct | CapturedMessage |
| struct | CategoryState |
| class | ILogSink |
| struct | LineFormat |
| class | LogCaptureSink |
| class | LogCategory |
| class | LogFileSink |
| struct | Message |
| class | OncePerKey |
Enumerations | |
| enum class | Level : u8 { kTrace , kDev , kDebug , kInfo , kWarn , kError , kCritical , kOff } |
| enum class | TimestampStyle : u8 { kNone , kClock , kDateTime , kElapsed } |
Functions | |
| Result< Level > | ParseLevel (std::string_view text) |
| std::string_view | LevelName (Level level) |
| void | Flush () |
| template<typename Fn> | |
| void | NoThrow (const LogCategory &category, Fn &&fn) noexcept |
| std::string | FormatLine (const Message &message, const LineFormat &format) |
| std::string_view | LevelColor (Level level) |
| char | LevelLetter (Level level) |
Variables | |
| constexpr std::array< std::string_view, 8 > | kLevelNames |
| constexpr size_t | kMessageLevelCount = 7 |
| constexpr std::string_view | kColorReset = "\x1b[0m" |
Log levels, categories, sinks and the logger.
|
strong |
Severity of a log message, least severe first.
|
strong |
| void rex::log::Flush | ( | ) |
Writes buffered output of every sink. For crash handlers that hold no API handle.
| std::string rex::log::FormatLine | ( | const Message & | message, |
| const LineFormat & | format ) |
Renders a message as a single line without a line break.
| std::string_view rex::log::LevelColor | ( | Level | level | ) |
Returns the ANSI SGR prefix of a level, empty for Info.
| char rex::log::LevelLetter | ( | Level | level | ) |
Returns the file column letter of a level.
| std::string_view rex::log::LevelName | ( | Level | level | ) |
Returns the lowercase name of a level. ParseLevel accepts the name.
|
noexcept |
Runs a teardown step and logs anything it throws instead of letting it escape.
| Fn | Callable that takes no arguments. |
| category | Category of the log line for a throw. |
Parses a level name.
| text | One of trace, dev, debug, info, warn, error, critical or off, in any case. |
|
inlineconstexpr |
The ANSI SGR code that ends a colored run.
|
inlineconstexpr |
Lowercase level names in level order, kOff last.
|
inlineconstexpr |
Number of levels a message can carry, kTrace through kCritical.