CPP04 1.0
|
The Logger class provides static methods for logging messages. [詳解]
#include <Logger.hpp>
公開型 | |
enum | LogLevel { LOG_INFO , LOG_WARNING , LOG_ERROR } |
Defines the severity levels for log messages. [詳解] | |
公開メンバ関数 | |
Logger () | |
Default constructor for Logger. | |
Logger (const Logger &other) | |
Copy constructor for Logger. | |
Logger & | operator= (const Logger &other) |
Copy assignment operator for Logger. | |
~Logger () | |
Destructor for Logger. | |
静的公開メンバ関数 | |
static void | log (LogLevel level, const std::string &message) |
Logs a message with a specified log level to the console. | |
The Logger class provides static methods for logging messages.
This class is designed to offer a simple and centralized way to output informational, warning, and error messages to the console. It follows the Orthodox Canonical Form for C++98, although its primary functionality is provided through static methods.
Logger.hpp の 37 行目に定義があります。
enum Logger::LogLevel |
Defines the severity levels for log messages.
列挙値 | |
---|---|
LOG_INFO | An informational message. |
LOG_WARNING | A warning message, indicating a potential issue. |
LOG_ERROR | An error message, indicating a significant problem. |
Logger.hpp の 42 行目に定義があります。
Logger::Logger | ( | ) |
Default constructor for Logger.
Initializes a Logger object. No specific initialization is performed as logging is handled via static methods.
Logger.cpp の 29 行目に定義があります。
Logger::Logger | ( | const Logger & | other | ) |
Copy constructor for Logger.
other | The Logger object to copy from. |
Logger.cpp の 44 行目に定義があります。
Logger::~Logger | ( | ) |
Destructor for Logger.
Cleans up resources held by the Logger object. No specific cleanup is performed as this class primarily offers static logging methods.
Logger.cpp の 37 行目に定義があります。
|
static |
Logs a message with a specified log level to the console.
Messages are printed to standard output (INFO) or standard error (WARNING, ERROR) based on the severity level.
level | The severity level of the log message (e.g., LOG_INFO, LOG_WARNING, LOG_ERROR). |
message | The string message to be logged. |
Logger.cpp の 66 行目に定義があります。
Copy assignment operator for Logger.
other | The Logger object to assign from. |
Logger.cpp の 52 行目に定義があります。