A class for logging messages to different locations such as text files or databases.
More...
#include <Logger.h>
|
| Logger () |
| Default constructor that initializes the logger with logging disabled.
|
|
| Logger (const Location &loc) |
| Constructor that initializes the logger with the specified logging location. More...
|
|
| Logger (const std::string &fileName, const Location &loc) |
| Constructor that initializes the logger with a file name and logging location. More...
|
|
| Logger (const Logger &)=delete |
| Copy constructor is deleted to prevent copying of the logger.
|
|
| ~Logger () |
| Destructor that cleans up resources used by the logger.
|
|
bool | log () |
| Logs an empty string. More...
|
|
bool | log (const std::string &message) |
| Logs a specific message. More...
|
|
bool | log (const std::initializer_list< std::string > &messages) |
| Logs multiple messages provided in an initializer list. More...
|
|
|
std::string | m_ClassName |
| The name of the class, intended for use by derived classes.
|
|
A class for logging messages to different locations such as text files or databases.
The Logger class provides functionality to log messages to various locations depending on the configuration.
◆ Location
Enum representing the possible logging locations.
Enumerator |
---|
DISABLED | Logging is disabled.
|
TEXT_FILE | Log messages to a text file.
|
DATABASE | Log messages to a database.
|
◆ Logger() [1/2]
Constructor that initializes the logger with the specified logging location.
- Parameters
-
loc | The location where logs should be written. |
◆ Logger() [2/2]
Logger::Logger |
( |
const std::string & |
fileName, |
|
|
const Location & |
loc |
|
) |
| |
Constructor that initializes the logger with a file name and logging location.
- Parameters
-
fileName | The name of the file where logs will be written. |
loc | The location where logs should be written. |
◆ log() [1/3]
Logs an empty string.
- Returns
- True if the log was successful, false otherwise.
◆ log() [2/3]
bool Logger::log |
( |
const std::initializer_list< std::string > & |
messages | ) |
|
Logs multiple messages provided in an initializer list.
- Parameters
-
messages | The list of messages to be logged. |
- Returns
- True if the log was successful, false otherwise.
◆ log() [3/3]
bool Logger::log |
( |
const std::string & |
message | ) |
|
Logs a specific message.
- Parameters
-
message | The message to be logged. |
- Returns
- True if the log was successful, false otherwise.
The documentation for this class was generated from the following files: