CPP04 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Logger クラス

The Logger class provides static methods for logging messages. [詳解]

#include <Logger.hpp>

Logger 連携図
Collaboration graph

公開型

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.
 
Loggeroperator= (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.hpp37 行目に定義があります。

列挙型メンバ詳解

◆ 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.hpp42 行目に定義があります。

構築子と解体子

◆ Logger() [1/2]

Logger::Logger ( )

Default constructor for Logger.

Initializes a Logger object. No specific initialization is performed as logging is handled via static methods.

Logger.cpp29 行目に定義があります。

◆ Logger() [2/2]

Logger::Logger ( const Logger other)

Copy constructor for Logger.

覚え書き
This class does not manage dynamic resources, so a shallow copy is sufficient.
引数
otherThe Logger object to copy from.

Logger.cpp44 行目に定義があります。

◆ ~Logger()

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.cpp37 行目に定義があります。

関数詳解

◆ log()

void Logger::log ( LogLevel  level,
const std::string message 
)
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.

引数
levelThe severity level of the log message (e.g., LOG_INFO, LOG_WARNING, LOG_ERROR).
messageThe string message to be logged.

Logger.cpp66 行目に定義があります。

◆ operator=()

Logger & Logger::operator= ( const Logger other)

Copy assignment operator for Logger.

覚え書き
This class does not manage dynamic resources, so a shallow copy is sufficient.
引数
otherThe Logger object to assign from.
戻り値
A reference to the current Logger object.

Logger.cpp52 行目に定義があります。


このクラス詳解は次のファイルから抽出されました: