diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2015-11-10 21:48:29 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2015-11-10 21:48:29 +0100 |
| commit | e4ccb9c3e8baae8632d52ec7158f64eabc2b4d76 (patch) | |
| tree | e3917f7036eacf720940e52337961b56022c6047 /src/CRSMLogging.hpp | |
| parent | 7ceb033275b40e72142db6395aa4fc5c5f669cd3 (diff) | |
| download | manager-e4ccb9c3e8baae8632d52ec7158f64eabc2b4d76.tar.gz manager-e4ccb9c3e8baae8632d52ec7158f64eabc2b4d76.zip | |
Add logging
Diffstat (limited to 'src/CRSMLogging.hpp')
| -rw-r--r-- | src/CRSMLogging.hpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/CRSMLogging.hpp b/src/CRSMLogging.hpp new file mode 100644 index 0000000..7f30b3e --- /dev/null +++ b/src/CRSMLogging.hpp @@ -0,0 +1,42 @@ +#pragma once + +#include <QFile> +#include <QMap> +#include <QString> + +#include "ClientInfo.hpp" + +class ScenarioSettings; + +class CRSMLogging +{ + QString logFolder; + QString mainLogName; + QString timestampFormat; + QFile mainLog; + QMap<QString, QFile*> logFiles; + + const char* cmdLogsFolder = "cmd/"; + const char* ircLogsFolder = "irc/"; + const char* modLogsFolder = "mod/"; + const char* userLogsFolder = "usr/"; + const char* clonkLogFile = "clonk"; + const char* clonkChatLogFile = "clonk.chat"; + const char* scensLogFile = "scenarios"; +public: + CRSMLogging(); + + QString setLogFolder(const QString& folder); + QString setMainLog(const QString& fileName); + void setTimestampFormat(const QString& format); + void log(const QString& message, const QString logFile = ""); + void clonkUserLog(const QString& message, const ClientInfo& client, bool action, bool command = false, bool response = false); + void modLog(const QString& message, const ClientInfo& client, const QString& modName, bool response); + void commandLog(const QString& message, const ClientInfo& client, bool response); + void ircLog(const QString& message, const QString &nick, bool query = false, QString channel = "", bool action = false, bool notice = false, bool response = false); + void ircUserLog(const QString& message, const ClientInfo &client, bool query, const QString &channel, bool action, bool notice); + void clonkChatLog(const QString& message); + void clonkLog(const QString& message); + void scenLog(const ScenarioSettings& scen); + QString formatIrcNick(const QString& nick, bool noChannel, const QString& channel, bool action, bool notice); +}; |
