]>
Commit | Line | Data |
---|---|---|
bbc27441 AJ |
1 | /* |
2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors | |
3 | * | |
4 | * Squid software is distributed under GPLv2+ license and includes | |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
7 | */ | |
8 | ||
f7f3304a | 9 | #include "squid.h" |
8a01b99e | 10 | #include "cache_cf.h" |
2eceb328 | 11 | #include "ConfigParser.h" |
af69c635 | 12 | #include "Debug.h" |
82b7abe3 AJ |
13 | #include "log/Config.h" |
14 | ||
15 | Log::LogConfig Log::TheConfig; | |
20efa1c2 AJ |
16 | |
17 | void | |
18 | Log::LogConfig::parseFormats() | |
19 | { | |
20 | char *name, *def; | |
21 | ||
2eceb328 | 22 | if ((name = ConfigParser::NextToken()) == NULL) |
20efa1c2 AJ |
23 | self_destruct(); |
24 | ||
2eceb328 CT |
25 | ::Format::Format *nlf = new ::Format::Format(name); |
26 | ||
27 | ConfigParser::EnableMacros(); | |
28 | if ((def = ConfigParser::NextQuotedOrToEol()) == NULL) { | |
20efa1c2 AJ |
29 | self_destruct(); |
30 | return; | |
31 | } | |
2eceb328 | 32 | ConfigParser::DisableMacros(); |
20efa1c2 | 33 | |
38e16f92 | 34 | debugs(3, 2, "Log Format for '" << name << "' is '" << def << "'"); |
20efa1c2 | 35 | |
38e16f92 | 36 | if (!nlf->parse(def)) { |
20efa1c2 AJ |
37 | self_destruct(); |
38 | return; | |
39 | } | |
40 | ||
41 | // add to global config list | |
42 | nlf->next = logformats; | |
43 | logformats = nlf; | |
44 | } | |
f53969cc | 45 |