|
| bool | Initialize (const LogConfig &config=LogConfig{}) noexcept |
| | Initialize the logger.
|
| |
| void | Deinitialize () noexcept |
| | Deinitialize the logger.
|
| |
| bool | IsInitialized () const noexcept |
| | Check if logger is initialized.
|
| |
| void | SetLogLevel (const char *tag, LogLevel level) noexcept |
| | Set log level for a tag.
|
| |
| LogLevel | GetLogLevel (const char *tag) const noexcept |
| | Get log level for a tag.
|
| |
| void | Error (const char *tag, const char *format,...) noexcept |
| | Log error message.
|
| |
| void | Warn (const char *tag, const char *format,...) noexcept |
| | Log warning message.
|
| |
| void | Info (const char *tag, const char *format,...) noexcept |
| | Log info message.
|
| |
| void | Debug (const char *tag, const char *format,...) noexcept |
| | Log debug message.
|
| |
| void | Verbose (const char *tag, const char *format,...) noexcept |
| | Log verbose message.
|
| |
| void | Error (const char *tag, LogColor color, LogStyle style, const char *format,...) noexcept |
| | Log error message with formatting.
|
| |
| void | Warn (const char *tag, LogColor color, LogStyle style, const char *format,...) noexcept |
| | Log warning message with formatting.
|
| |
| void | Info (const char *tag, LogColor color, LogStyle style, const char *format,...) noexcept |
| | Log info message with formatting.
|
| |
| void | Debug (const char *tag, LogColor color, LogStyle style, const char *format,...) noexcept |
| | Log debug message with formatting.
|
| |
| void | Verbose (const char *tag, LogColor color, LogStyle style, const char *format,...) noexcept |
| | Log verbose message with formatting.
|
| |
| void | LogAsciiArt (const char *tag, const char *ascii_art, const AsciiArtFormat &format=AsciiArtFormat{}) noexcept |
| | Log ASCII art.
|
| |
| void | LogAsciiArt (LogLevel level, const char *tag, const char *ascii_art, const AsciiArtFormat &format=AsciiArtFormat{}) noexcept |
| | Log ASCII art with log level.
|
| |
| void | LogBanner (const char *tag, const char *ascii_art, const AsciiArtFormat &format=AsciiArtFormat{}) noexcept |
| | Log ASCII art banner.
|
| |
| void | SetConfig (const LogConfig &config) noexcept |
| | Set default configuration.
|
| |
| LogConfig | GetConfig () const noexcept |
| | Get current configuration.
|
| |
| void | EnableColors (bool enable) noexcept |
| | Enable/disable colors.
|
| |
| void | EnableEffects (bool enable) noexcept |
| | Enable/disable effects.
|
| |
| void | EnableAsciiArt (bool enable) noexcept |
| | Enable/disable ASCII art support.
|
| |
| void | Flush () noexcept |
| | Flush any buffered output.
|
| |
|
| | Logger () noexcept |
| | Constructor.
|
| |
| | ~Logger () noexcept |
| | Destructor.
|
| |
| | Logger (const Logger &)=delete |
| | Copy constructor (deleted)
|
| |
| Logger & | operator= (const Logger &)=delete |
| | Assignment operator (deleted)
|
| |
| | Logger (Logger &&)=delete |
| | Move constructor (deleted)
|
| |
| Logger & | operator= (Logger &&)=delete |
| | Move assignment operator (deleted)
|
| |
| void | LogInternal (LogLevel level, const char *tag, LogColor color, LogStyle style, const char *format, va_list args) noexcept |
| | Internal logging method.
|
| |
| size_t | WriteColorPrefix (char *buf, size_t buf_size, LogColor color, LogBackground background, LogStyle style) const noexcept |
| | Write ANSI color/style prefix into a buffer.
|
| |
| void | FormatAndLogAsciiArt (const char *tag, LogLevel level, const char *ascii_art, const AsciiArtFormat &format) noexcept |
| | Format and log ASCII art line-by-line without heap allocation.
|
| |
| bool | IsLevelEnabled (LogLevel level, const char *tag) const noexcept |
| | Check if log level is enabled for tag.
|
| |
| std::unique_ptr< BaseLogger > | CreateBaseLogger () noexcept |
| | Create base logger instance.
|
| |
| void | DumpStatistics () const noexcept |
| | Dump comprehensive logger statistics to log as INFO level. Logs internal logger statistics, configuration, and performance metrics.
|
| |
Advanced logging system with formatting capabilities.
This class provides a comprehensive logging solution that supports various formatting options including colors, styles, and effects. It can also handle ASCII art formatting and display.
Key Features:
- Multiple Log Levels: Error, Warn, Info, Debug, Verbose
- Color Support: ANSI color codes for text and background
- Text Styling: Bold, italic, underline, strikethrough
- ASCII Art Support: Format and display ASCII art
- Effects: Borders, centering, padding
- Performance Optimized: Efficient string handling
- Thread Safe: Safe for multi-threaded environments
Usage Example:
logger.
Info(
"TAG",
"Hello World");
const char* ascii_art = "...";
Advanced logging system with formatting capabilities.
Definition Logger.h:158
void Info(const char *tag, const char *format,...) noexcept
Log info message.
Definition Logger.cpp:192
static Logger & GetInstance() noexcept
Get singleton instance.
Definition Logger.cpp:61
void LogAsciiArt(const char *tag, const char *ascii_art, const AsciiArtFormat &format=AsciiArtFormat{}) noexcept
Log ASCII art.
Definition Logger.cpp:288