summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-09 12:41:17 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-09 12:41:17 +0000
commitaf7e1a1ca8b36064593becf62b1a91468ad32237 (patch)
tree6d2bdd3f4522c7bff69306fb6d3aa2f488e38d9c /include
parentdb1c78986c8055f59b9bdf98a883dfbf3f4db6b9 (diff)
New logging implementation. Also write messages about InspIRCd::Log() being deprecated. Any takers on changing it all to use the new system? :P. STILL TODO: create <log> blocks in config, add a method called to 'cleanup' (or use destructor) of logstreams, add a method to logmanager to initiate destruction of all logstreams.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8858 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/filelogger.h12
-rw-r--r--include/inspircd.h4
-rw-r--r--include/logger.h5
3 files changed, 15 insertions, 6 deletions
diff --git a/include/filelogger.h b/include/filelogger.h
index 77ca6f886..8395f1c96 100644
--- a/include/filelogger.h
+++ b/include/filelogger.h
@@ -88,5 +88,17 @@ class CoreExport FileLogger : public EventHandler
virtual ~FileLogger();
};
+class CoreExport FileLogStream : public LogStream
+{
+ private:
+ FileLogger *f;
+ public:
+ FileLogStream(InspIRCd *Instance, FILE *f, const std::string &type) : LogStream(Instance, type)
+ {
+ this->f = new FileLogger(Instance, f);
+ }
+
+ virtual void OnLog(int loglevel, const std::string &msg);
+};
#endif
diff --git a/include/inspircd.h b/include/inspircd.h
index e8d5c9b8e..5f57619d5 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -304,10 +304,6 @@ class CoreExport InspIRCd : public classbase
*/
socklen_t length;
- /** Nonblocking file writer
- */
- FileLogger* Logger;
-
/** Time offset in seconds
* This offset is added to all calls to Time(). Use SetTimeDelta() to update
*/
diff --git a/include/logger.h b/include/logger.h
index 1e043f4f1..d32c3d184 100644
--- a/include/logger.h
+++ b/include/logger.h
@@ -16,7 +16,7 @@
class CoreExport LogStream : public classbase
{
- private:
+ protected:
InspIRCd *ServerInstance;
std::string type;
public:
@@ -26,7 +26,7 @@ class CoreExport LogStream : public classbase
this->type = type;
}
- virtual void OnLog(int loglevel, const std::string &msg);
+ virtual void OnLog(int loglevel, const std::string &msg) { }
};
class CoreExport LogManager : public classbase
@@ -34,6 +34,7 @@ class CoreExport LogManager : public classbase
private:
InspIRCd *ServerInstance;
std::map<std::string, std::vector<LogStream *> > LogStreams;
+ std::vector<LogStream *> GlobalLogStreams; //holds all logstreams with a type of *
public:
LogManager(InspIRCd *Instance)
{