- Docs: log { } from 'optional' -> 'recomended'

- If no log { } block is present a warning will be printed out and we will fallback
  to a default of logging errors to ircd.log. Suggested by w00t ().
This commit is contained in:
Bram Matthys 2005-02-13 00:20:11 +00:00
parent 9c38686f52
commit ab103a74cd
3 changed files with 17 additions and 1 deletions

View file

@ -598,3 +598,6 @@
Bugz (#0002198). Obviously all servers need to be upgraded to make this work.
- Fixed SVSNOOP bug where remote servers still thought the opers had privileges, reported
by Zell (#0002185)
- Docs: log { } from 'optional' -> 'recomended'
- If no log { } block is present a warning will be printed out and we will fallback
to a default of logging errors to ircd.log. Suggested by w00t (#0002327).

View file

@ -1250,7 +1250,7 @@ loadmodule "modules/cloak.dll";
</pre>
</div>
<p><font class="block_section">4.11 - </font><font class="block_name">Log Block</font>
<font class="block_optional">OPTIONAL</font><a name="logblock"></a><div class="desc">
<font class="block_recommended">RECOMMENDED</font><a name="logblock"></a><div class="desc">
</p>
<p>Syntax:<br>
<pre>

View file

@ -1570,6 +1570,17 @@ char *encoded;
}
}
static void make_default_logblock(void)
{
ConfigItem_log *ca = MyMallocEx(sizeof(ConfigItem_log));
config_status("No log { } block found -- using default: errors will be logged to 'ircd.log'");
ca->file = strdup("ircd.log");
ca->flags |= LOG_ERROR;
AddListItem(ca, conf_log);
}
int init_conf(char *rootconf, int rehash)
{
config_status("Loading IRCd configuration ..");
@ -1673,6 +1684,8 @@ int init_conf(char *rootconf, int rehash)
RunHook0(HOOKTYPE_REHASH_COMPLETE);
}
do_weird_shun_stuff();
if (!conf_log)
make_default_logblock();
nextconnect = TStime() + 1; /* check for autoconnects */
config_status("Configuration loaded without any problems ..");
return 0;