X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Flogger.cpp;h=b33f65ac4b7856dd6bfed3c23a34887b2cb36059;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=41363b4142154b7489ac3ff144f04d9b3f9f1e05;hpb=f3dc5572200b4bce6b09448ac4660e2d889cb038;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/logger.cpp b/src/logger.cpp index 41363b414..b33f65ac4 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -1,16 +1,25 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon + * + * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2008 Craig Edwards + * Copyright (C) 2008 Thomas Stagner + * Copyright (C) 2008 Robin Burchell * - * InspIRCd: (C) 2002-2010 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * 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. * - * This program is free but copyrighted software; see - * the file COPYING for details. + * 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 . */ + #include "inspircd.h" #include "filelogger.h" @@ -53,7 +62,7 @@ LogManager::~LogManager() void LogManager::OpenFileLogs() { - if (Config->cmdline.forcedebug) + if (ServerInstance->Config->cmdline.forcedebug) { ServerInstance->Config->RawLog = true; return; @@ -73,31 +82,31 @@ void LogManager::OpenFileLogs() } std::string type = tag->getString("type"); std::string level = tag->getString("level"); - int loglevel = DEFAULT; + int loglevel = LOG_DEFAULT; if (level == "rawio") { - loglevel = RAWIO; + loglevel = LOG_RAWIO; ServerInstance->Config->RawLog = true; } else if (level == "debug") { - loglevel = DEBUG; + loglevel = LOG_DEBUG; } else if (level == "verbose") { - loglevel = VERBOSE; + loglevel = LOG_VERBOSE; } else if (level == "default") { - loglevel = DEFAULT; + loglevel = LOG_DEFAULT; } else if (level == "sparse") { - loglevel = SPARSE; + loglevel = LOG_SPARSE; } else if (level == "none") { - loglevel = NONE; + loglevel = LOG_NONE; } FileWriter* fw; std::string target = tag->getString("target"); @@ -117,14 +126,14 @@ void LogManager::OpenFileLogs() fw = fwi->second; } FileLogStream* fls = new FileLogStream(loglevel, fw); - fls->OnLog(SPARSE, "HEADER", InspIRCd::LogHeader); + fls->OnLog(LOG_SPARSE, "HEADER", InspIRCd::LogHeader); AddLogTypes(type, fls, true); } } void LogManager::CloseLogs() { - if (Config->cmdline.forcedebug) + if (ServerInstance->Config && ServerInstance->Config->cmdline.forcedebug) return; std::map >().swap(LogStreams); /* Clear it */ std::map >().swap(GlobalLogStreams); /* Clear it */