Max OS 0.3
Loading...
Searching...
No Matches
logger.h File Reference

Defines a Logger class for logging messages with different severity levels to multiple output streams. More...

#include <libcommon/outputStream.h>
#include <libcommon/colour.h>
#include <libcommon/spinlock.h>

Go to the source code of this file.

Classes

class  MaxOS::Logger
 A class that handles logging messages to the console and files. More...
 
class  MaxOS::LogRecord
 A single logging event. More...
 

Enumerations

enum class  MaxOS::LogLevel {
  OUT , ERROR , WARNING , HEADER ,
  INFO , TEST , DEBUG
}
 Priority levels for logging messages. Different levels may be used to filter messages based on their importance depending on build type. More...
 

Variables

constexpr uint8_t MaxOS::MAX_LOG_WRITERS = 5
 The maximum number of log writers that can be added to the logger.
 
constexpr LogLevel MaxOS::MAX_LOG_LEVEL = LogLevel::DEBUG
 The maximum log level for this build (messages above this level will not be logged)
 

Detailed Description

Defines a Logger class for logging messages with different severity levels to multiple output streams.

Date
4th April 2025
Author
Max Tyson
Todo:
move somewhere else (maybe even commonlib), rename common/ to generated/

Definition in file logger.h.

Enumeration Type Documentation

◆ LogLevel

enum class MaxOS::LogLevel
strong

Priority levels for logging messages. Different levels may be used to filter messages based on their importance depending on build type.

Definition at line 25 of file logger.h.

25 {
26 OUT,
27 ERROR,
28 WARNING,
29 HEADER,
30 INFO,
31 TEST,
32 DEBUG,
33 };

Variable Documentation

◆ MAX_LOG_LEVEL

constexpr LogLevel MaxOS::MAX_LOG_LEVEL = LogLevel::DEBUG
constexpr

The maximum log level for this build (messages above this level will not be logged)

Definition at line 40 of file logger.h.

Referenced by MaxOS::Logger::write_char().

◆ MAX_LOG_WRITERS

constexpr uint8_t MaxOS::MAX_LOG_WRITERS = 5
constexpr

The maximum number of log writers that can be added to the logger.

Definition at line 36 of file logger.h.

Referenced by MaxOS::Logger::add_log_writer().