HardFOC Core
API reference
Loading...
Searching...
No Matches
LogDecorators.h
Go to the documentation of this file.
1#pragma once
2
3#include "Logger.h"
4
5namespace logger_decor {
6
7inline void BannerColored(const char* tag, const char* line1,
8 LogColor color) noexcept {
9 auto& logger = Logger::GetInstance();
10 logger.Info(tag, "");
11 logger.Info(tag, color, LogStyle::BOLD,
12 "+==========================================================+");
13 logger.Info(tag, color, LogStyle::BOLD,
14 "| %-54s |", line1);
15 logger.Info(tag, color, LogStyle::BOLD,
16 "+==========================================================+");
17 logger.Info(tag, "");
18}
19
20inline void Banner(const char* tag, const char* line1) noexcept {
21 BannerColored(tag, line1, LogColor::CYAN);
22}
23
24inline void Section(const char* tag, const char* title) noexcept {
26 "-- %s --", title);
27}
28
29inline void Rule(const char* tag) noexcept {
30 Logger::GetInstance().Info(tag, "============================================================");
31}
32
33} // namespace logger_decor
Advanced logging system with formatting capabilities.
LogColor
Text colors (ANSI color codes)
Definition Logger.h:39
@ CYAN
Cyan.
@ BRIGHT_BLUE
Bright blue.
@ BOLD
Bold text.
void Info(const char *tag, const char *format,...) noexcept
Log info message.
Definition Logger.cpp:244
static Logger & GetInstance() noexcept
Get singleton instance.
Definition Logger.cpp:91
Definition LogDecorators.h:5
void BannerColored(const char *tag, const char *line1, LogColor color) noexcept
Definition LogDecorators.h:7
void Banner(const char *tag, const char *line1) noexcept
Definition LogDecorators.h:20
void Rule(const char *tag) noexcept
Definition LogDecorators.h:29
void Section(const char *tag, const char *title) noexcept
Definition LogDecorators.h:24