From e86afd775c59441ff66222b2c3142b01ec2113af Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 14 Dec 2005 11:45:04 +0000 Subject: Finished moving main config items into class ServerConfig git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2399 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/inspircd.h | 8 -------- include/inspircd_io.h | 10 +++++++++- src/inspircd.cpp | 4 +++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/inspircd.h b/include/inspircd.h index dc440708e..1499e9847 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -51,14 +51,6 @@ #define MAXSOCKS 64 #define MAXCOMMAND 32 -// flags for use with log() - -#define DEBUG 10 -#define VERBOSE 20 -#define DEFAULT 30 -#define SPARSE 40 -#define NONE 50 - // flags for use with WriteMode #define WM_AND 1 diff --git a/include/inspircd_io.h b/include/inspircd_io.h index 200c4a8c2..c09d611bf 100644 --- a/include/inspircd_io.h +++ b/include/inspircd_io.h @@ -21,6 +21,14 @@ #include #include "inspircd.h" +// flags for use with log() + +#define DEBUG 10 +#define VERBOSE 20 +#define DEFAULT 30 +#define SPARSE 40 +#define NONE 50 + class ServerConfig { public: @@ -82,7 +90,7 @@ class ServerConfig MaxConn = SOMAXCONN; MaxWhoResults = 100; debugging = 0; - LogLevel = 30; + LogLevel = DEFAULT; DieDelay = 5; } }; diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 104923b67..873e48a22 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -318,6 +318,7 @@ void ReadConfig(bool bail, userrec* user) log(DEFAULT,"No MaxWhoResults specified or size out of range, setting to default of 128."); Config->MaxWhoResults = 128; } + Config->LogLevel = DEFAULT; if (!strcmp(dbg,"debug")) { Config->LogLevel = DEBUG; @@ -331,6 +332,7 @@ void ReadConfig(bool bail, userrec* user) Config->LogLevel = SPARSE; if (!strcmp(dbg,"none")) Config->LogLevel = NONE; + readfile(MOTD,Config->motd); log(DEFAULT,"Reading message of the day..."); readfile(RULES,Config->rules); @@ -2231,9 +2233,9 @@ int InspIRCd(char** argv, int argc) * into smaller sub-functions, much tidier -- Brain */ OpenLog(argv, argc); + ReadConfig(true,NULL); CheckRoot(); SetupCommandTable(); - ReadConfig(true,NULL); AddServerName(Config->ServerName); CheckDie(); boundPortCount = BindPorts(); -- cgit v1.2.3