summaryrefslogtreecommitdiff
path: root/src/log.h
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-12-10 02:50:15 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-12-10 02:50:15 +0000
commit2820f4d4329f29fc75c85d6b2195fd42b97fd457 (patch)
tree2e48985cf1fddad7b37afcc3eefaeb75ed1d1ee3 /src/log.h
parente961be5bfd29ad3f44f948828981cb3ab07f25a7 (diff)
downloadmana-2820f4d4329f29fc75c85d6b2195fd42b97fd457.tar.gz
mana-2820f4d4329f29fc75c85d6b2195fd42b97fd457.tar.bz2
mana-2820f4d4329f29fc75c85d6b2195fd42b97fd457.tar.xz
mana-2820f4d4329f29fc75c85d6b2195fd42b97fd457.zip
Added an option to show log messages in the chat console.
Diffstat (limited to 'src/log.h')
-rw-r--r--src/log.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/log.h b/src/log.h
index 36328527..dd1c0f91 100644
--- a/src/log.h
+++ b/src/log.h
@@ -25,6 +25,8 @@
#include <iosfwd>
#include <fstream>
+class ChatWindow;
+
/**
* The Log Class : Useful to write debug or info messages
*/
@@ -52,6 +54,11 @@ class Logger
void setLogToStandardOut(bool value) { mLogToStandardOut = value; }
/**
+ * Enables logging to chat window
+ */
+ void setChatWindow(ChatWindow *window) { mChatWindow = window; }
+
+ /**
* Enters a message in the log. The message will be timestamped.
*/
void log(const char *log_text, ...);
@@ -65,6 +72,7 @@ class Logger
private:
std::ofstream mLogFile;
bool mLogToStandardOut;
+ ChatWindow *mChatWindow;
};
extern Logger *logger;