ManaPlus
|
#include <chatlogger.h>
Public Member Functions | |
ChatLogger () | |
~ChatLogger () | |
void | log (std::string str) |
void | log (std::string name, std::string str) |
void | loadLast (std::string name, std::list< std::string > &list, const unsigned int n) const |
std::string | getDir () const |
void | setServerName (const std::string &serverName) |
void | setBaseLogDir (const std::string &logDir) |
void | clear () |
Static Public Member Functions | |
static std::string | secureName (std::string &str) |
Private Member Functions | |
void | setLogFile (const std::string &logFilename) |
void | setLogDir (const std::string &logDir) |
Static Private Member Functions | |
static void | writeTo (std::ofstream &file, const std::string &str) |
Private Attributes | |
std::ofstream | mLogFile |
std::string | mLogDir |
std::string | mBaseLogDir |
std::string | mServerName |
std::string | mLogFileName |
Definition at line 31 of file chatlogger.h.
ChatLogger::ChatLogger | ( | ) |
ChatLogger::~ChatLogger | ( | ) |
void ChatLogger::clear | ( | ) |
Definition at line 228 of file chatlogger.cpp.
References mLogDir, mLogFileName, and mServerName.
std::string ChatLogger::getDir | ( | ) | const |
Definition at line 124 of file chatlogger.cpp.
References mBaseLogDir, mServerName, and strprintf().
Referenced by loadLast(), and log().
void ChatLogger::loadLast | ( | std::string | name, |
std::list< std::string > & | list, | ||
const unsigned int | n | ||
) | const |
Definition at line 197 of file chatlogger.cpp.
References CAST_U32, fileName, getDir(), secureName(), and strprintf().
Referenced by ChatTab::loadFromLogFile().
void ChatLogger::log | ( | std::string | name, |
std::string | str | ||
) |
Definition at line 107 of file chatlogger.cpp.
References getDir(), mLogFile, mLogFileName, removeColors(), secureName(), setLogDir(), setLogFile(), strprintf(), and writeTo().
void ChatLogger::log | ( | std::string | str | ) |
Enters a message in the log. The message will be timestamped.
Definition at line 91 of file chatlogger.cpp.
References getDir(), mLogFile, mLogFileName, removeColors(), setLogDir(), setLogFile(), strprintf(), and writeTo().
Referenced by ChatTab::saveToLogFile().
|
static |
Definition at line 144 of file chatlogger.cpp.
Referenced by loadLast(), log(), and setServerName().
|
inline |
|
private |
Definition at line 77 of file chatlogger.cpp.
References mkdir_r(), mLogDir, and mLogFile.
Referenced by log().
|
private |
Sets the file to log to and opens it
Definition at line 60 of file chatlogger.cpp.
References mLogFile, and mLogFileName.
Referenced by log().
void ChatLogger::setServerName | ( | const std::string & | serverName | ) |
Definition at line 176 of file chatlogger.cpp.
References config, Configuration::getStringValue(), mkdir_r(), mLogDir, mLogFile, mServerName, pathJoin(), and secureName().
Referenced by ServerDialog::connectToSelectedServer().
|
staticprivate |
Definition at line 170 of file chatlogger.cpp.
Referenced by log().
|
private |
Definition at line 81 of file chatlogger.h.
Referenced by getDir(), and setBaseLogDir().
|
private |
Definition at line 80 of file chatlogger.h.
Referenced by clear(), setLogDir(), and setServerName().
|
private |
Definition at line 79 of file chatlogger.h.
Referenced by log(), setLogDir(), setLogFile(), setServerName(), and ~ChatLogger().
|
private |
Definition at line 83 of file chatlogger.h.
Referenced by clear(), log(), and setLogFile().
|
private |
Definition at line 82 of file chatlogger.h.
Referenced by clear(), getDir(), and setServerName().