Event-Driven Programming in C++ 1.0
A case study on event-driven programming in C++
Loading...
Searching...
No Matches
logger.hpp
Go to the documentation of this file.
1
11#ifndef LOGGER_HPP
12#define LOGGER_HPP
13
14#include <string>
15
29namespace common {
30
34enum class LogLevel {
35 Debug,
36 Info,
37 Warning,
38 Error
39};
40
47class Logger {
48public:
57 static void setLogLevel(LogLevel level);
58
64 static void debug(const std::string &message);
65
71 static void info(const std::string &message);
72
78 static void warning(const std::string &message);
79
85 static void error(const std::string &message);
86
87private:
94 static std::string logLevelToString(LogLevel level);
95
102};
103
104} // namespace common
105
106#endif // LOGGER_HPP
A simple logging utility.
Definition logger.hpp:47
static void info(const std::string &message)
Logs an informational message.
Definition logger.cpp:36
static void debug(const std::string &message)
Logs a debug message.
Definition logger.cpp:30
static std::string logLevelToString(LogLevel level)
Converts a LogLevel to its string representation.
Definition logger.cpp:20
static void setLogLevel(LogLevel level)
Sets the current log level.
Definition logger.cpp:16
static LogLevel currentLevel
The current logging level.
Definition logger.hpp:101
static void warning(const std::string &message)
Logs a warning message.
Definition logger.cpp:42
static void error(const std::string &message)
Logs an error message.
Definition logger.cpp:48
Contains shared utilities and helper functions used across the project.
Definition logger.cpp:12
LogLevel
Enumeration of log levels.
Definition logger.hpp:34
@ Warning
Warning log level.
@ Info
Informational log level.
@ Error
Error log level.
@ Debug
Debug log level.