2012-04-19 20:58:29 +02:00
|
|
|
/*
|
|
|
|
* InspIRCd -- Internet Relay Chat Daemon
|
2007-07-25 11:54:08 +00:00
|
|
|
*
|
2012-04-19 20:58:29 +02:00
|
|
|
* Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
|
|
|
|
* Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
|
2007-07-25 11:54:08 +00:00
|
|
|
*
|
2012-04-19 20:58:29 +02:00
|
|
|
* This file is part of InspIRCd. InspIRCd is free software: you can
|
|
|
|
* redistribute it and/or modify it under the terms of the GNU General Public
|
|
|
|
* License as published by the Free Software Foundation, version 2.
|
2007-07-25 11:54:08 +00:00
|
|
|
*
|
2012-04-19 20:58:29 +02:00
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2007-07-25 11:54:08 +00:00
|
|
|
*/
|
|
|
|
|
2012-04-19 20:58:29 +02:00
|
|
|
|
2012-04-14 20:21:38 -07:00
|
|
|
#ifndef FILELOGGER_H
|
|
|
|
#define FILELOGGER_H
|
2007-07-25 11:54:08 +00:00
|
|
|
|
2008-02-10 20:07:30 +00:00
|
|
|
#include "logger.h"
|
|
|
|
|
2007-07-25 11:54:08 +00:00
|
|
|
/** Debug levels for use with InspIRCd::Log()
|
|
|
|
* */
|
|
|
|
enum DebugLevel
|
|
|
|
{
|
2010-03-19 18:06:39 +00:00
|
|
|
RAWIO = 5,
|
2007-07-25 11:54:08 +00:00
|
|
|
DEBUG = 10,
|
|
|
|
VERBOSE = 20,
|
|
|
|
DEFAULT = 30,
|
|
|
|
SPARSE = 40,
|
|
|
|
NONE = 50
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Forward declaration -- required */
|
|
|
|
class InspIRCd;
|
|
|
|
|
2008-09-20 21:14:25 +00:00
|
|
|
/** A logging class which logs to a streamed file.
|
|
|
|
*/
|
2008-02-09 12:41:17 +00:00
|
|
|
class CoreExport FileLogStream : public LogStream
|
|
|
|
{
|
|
|
|
private:
|
2008-02-10 20:07:30 +00:00
|
|
|
FileWriter *f;
|
2008-02-09 12:41:17 +00:00
|
|
|
public:
|
2009-09-26 14:13:13 +00:00
|
|
|
FileLogStream(int loglevel, FileWriter *fw);
|
2008-02-09 12:41:17 +00:00
|
|
|
|
2008-02-10 20:07:30 +00:00
|
|
|
virtual ~FileLogStream();
|
2008-02-09 13:18:41 +00:00
|
|
|
|
2008-02-09 21:00:07 +00:00
|
|
|
virtual void OnLog(int loglevel, const std::string &type, const std::string &msg);
|
2008-02-09 12:41:17 +00:00
|
|
|
};
|
2007-07-25 11:54:08 +00:00
|
|
|
|
|
|
|
#endif
|
2008-09-20 21:14:25 +00:00
|
|
|
|