From bf6724c049ba0f156544c49aab2008d6280e5ffa Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 17 Oct 2009 02:14:44 +0000 Subject: Rewrite ConfigReader again git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11879 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/logger.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/logger.cpp') diff --git a/src/logger.cpp b/src/logger.cpp index e2baa4b8d..c9b1cf9e4 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -11,8 +11,6 @@ * --------------------------------------------------- */ -/* $Core */ - #include "inspircd.h" #include "filelogger.h" @@ -73,15 +71,18 @@ void LogManager::OpenFileLogs() ConfigReader* Conf = new ConfigReader; std::map logmap; std::map::iterator i; - for (int index = 0; index < Conf->Enumerate("log"); ++index) + for (int index = 0;; ++index) { - std::string method = Conf->ReadValue("log", "method", index); + ConfigTag* tag = ServerInstance->Config->ConfValue("log", index); + if (!tag) + break; + std::string method = tag->getString("method"); if (method != "file") { continue; } - std::string type = Conf->ReadValue("log", "type", index); - std::string level = Conf->ReadValue("log", "level", index); + std::string type = tag->getString("type"); + std::string level = tag->getString("level"); int loglevel = DEFAULT; if (level == "debug" || ServerInstance->Config->forcedebug) { -- cgit v1.3.1-10-gc9f91