X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Ffilelogger.cpp;h=8ed66eca29cd0eeeb923b26e65216bfcb4bb9259;hb=92974819e3bf1c3a97b83f6f4ccc612283120794;hp=b0eb77310eca945fb875a2dd62bdbe2173d7ee27;hpb=4965a1d6697565b1a72de31deaccfd93180bd403;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/filelogger.cpp b/src/filelogger.cpp index b0eb77310..8ed66eca2 100644 --- a/src/filelogger.cpp +++ b/src/filelogger.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2010 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -11,16 +11,15 @@ * --------------------------------------------------- */ -/* $Core: libIRCDfilelogger */ +/* $Core */ #include "inspircd.h" #include #include "socketengine.h" -#include "inspircd_se_config.h" #include "filelogger.h" -FileLogStream::FileLogStream(InspIRCd *Instance, int loglevel, FileWriter *fw) - : LogStream(Instance, loglevel), f(fw) +FileLogStream::FileLogStream(int loglevel, FileWriter *fw) + : LogStream(loglevel), f(fw) { ServerInstance->Logs->AddLoggerRef(f); } @@ -36,13 +35,10 @@ void FileLogStream::OnLog(int loglevel, const std::string &type, const std::stri static char TIMESTR[26]; static time_t LAST = 0; - /* sanity check, just in case */ - if (!ServerInstance->Config) - return; - - /* If we were given -debug we output all messages, regardless of configured loglevel */ - if ((loglevel < this->loglvl) && !ServerInstance->Config->forcedebug) + if (loglevel < this->loglvl) + { return; + } if (ServerInstance->Time() != LAST) { @@ -54,14 +50,6 @@ void FileLogStream::OnLog(int loglevel, const std::string &type, const std::stri LAST = ServerInstance->Time(); } - if (ServerInstance->Config->log_file && ServerInstance->Config->writelog) - { - std::string out = std::string(TIMESTR) + " " + text.c_str() + "\n"; - this->f->WriteLogLine(out); - } - - if (ServerInstance->Config->nofork) - { - printf("%s %s\n", TIMESTR, text.c_str()); - } + std::string out = std::string(TIMESTR) + " " + text.c_str() + "\n"; + this->f->WriteLogLine(out); }