]> git.ipfire.org Git - thirdparty/squid.git/blob - src/log/Config.cc
merge from trunk
[thirdparty/squid.git] / src / log / Config.cc
1 #include "squid.h"
2 #include "cache_cf.h"
3 #include "ConfigParser.h"
4 #include "Debug.h"
5 #include "log/Config.h"
6
7 Log::LogConfig Log::TheConfig;
8
9 void
10 Log::LogConfig::parseFormats()
11 {
12 char *name, *def;
13
14 if ((name = ConfigParser::NextToken()) == NULL)
15 self_destruct();
16
17 ::Format::Format *nlf = new ::Format::Format(name);
18
19 ConfigParser::EnableMacros();
20 if ((def = ConfigParser::NextQuotedOrToEol()) == NULL) {
21 self_destruct();
22 return;
23 }
24 ConfigParser::DisableMacros();
25
26 debugs(3, 2, "Log Format for '" << name << "' is '" << def << "'");
27
28 if (!nlf->parse(def)) {
29 self_destruct();
30 return;
31 }
32
33 // add to global config list
34 nlf->next = logformats;
35 logformats = nlf;
36 }