Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ChatLogger Class Reference

#include <chatlogger.h>

Public Member Functions

 ChatLogger ()=default
 
 ~ChatLogger ()
 
void setLogDir (const std::string &logDir)
 
void log (std::string str)
 Enters a message in the log.
 
void log (std::string name, std::string str)
 
void setServerName (const std::string &serverName)
 

Private Member Functions

void setLogFile (const std::string &logFilename)
 Sets the file to log to and opens it.
 

Private Attributes

std::ofstream mLogFile
 
std::string mLogDir
 
std::string mServerName
 
std::string mLogDate
 

Detailed Description

Definition at line 26 of file chatlogger.h.

Constructor & Destructor Documentation

◆ ChatLogger()

ChatLogger::ChatLogger ( )
default

◆ ~ChatLogger()

ChatLogger::~ChatLogger ( )
default

Member Function Documentation

◆ log() [1/2]

void ChatLogger::log ( std::string  name,
std::string  str 
)

Definition at line 132 of file chatlogger.cpp.

◆ log() [2/2]

void ChatLogger::log ( std::string  str)

Enters a message in the log.

The message will be timestamped.

Definition at line 116 of file chatlogger.cpp.

◆ setLogDir()

void ChatLogger::setLogDir ( const std::string &  logDir)

Definition at line 102 of file chatlogger.cpp.

◆ setLogFile()

void ChatLogger::setLogFile ( const std::string &  logFilename)
private

Sets the file to log to and opens it.

Definition at line 88 of file chatlogger.cpp.

◆ setServerName()

void ChatLogger::setServerName ( const std::string &  serverName)

Definition at line 150 of file chatlogger.cpp.

Member Data Documentation

◆ mLogDate

std::string ChatLogger::mLogDate
private

Definition at line 51 of file chatlogger.h.

◆ mLogDir

std::string ChatLogger::mLogDir
private

Definition at line 49 of file chatlogger.h.

◆ mLogFile

std::ofstream ChatLogger::mLogFile
private

Definition at line 48 of file chatlogger.h.

◆ mServerName

std::string ChatLogger::mServerName
private

Definition at line 50 of file chatlogger.h.


The documentation for this class was generated from the following files: