Squid Web Cache master
Loading...
Searching...
No Matches
Config.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 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
9#ifndef SQUID_SRC_LOG_CONFIG_H
10#define SQUID_SRC_LOG_CONFIG_H
11
12#include "format/Format.h"
13#include "log/Formats.h"
14
15class StoreEntry;
16
17namespace Log
18{
19
21{
22public:
24 static const char *BuiltInFormatName(Format::log_type type);
25
27 static Format::log_type FindBuiltInFormat(const char *logformatName);
28 static_assert(!Log::Format::CLF_UNKNOWN, "FindBuiltInFormat(unknown) is falsy");
29
31 ::Format::Format *findCustomFormat(const char *logformatName) const;
32
35 bool knownFormat(const char *logformatName) const;
36
37 void parseFormats();
38 void dumpFormats(StoreEntry *e, const char *name) {
39 if (logformats)
40 logformats->dump(e, name);
41 }
42
45
48
49#if USE_ADAPTATION
51#endif
52
53#if ICAP_CLIENT
55#endif
56};
57
58extern LogConfig TheConfig;
59
60} // namespace Log
61
62// Legacy parsing wrappers
63#define parse_logformat(X) (X)->parseFormats()
64#define free_logformat(X) do{ delete (*X).logformats; (*X).logformats=NULL; }while(false)
65#define dump_logformat(E,N,D) (D).dumpFormats((E),(N))
66
67#endif /* SQUID_SRC_LOG_CONFIG_H */
68
void dump(StoreEntry *entry, const char *directiveName, bool eol=true) const
dump this whole list of formats into the provided StoreEntry
Definition Format.cc:117
static const char * BuiltInFormatName(Format::log_type type)
Definition Config.cc:18
bool knownFormat(const char *logformatName) const
Definition Config.cc:98
static Format::log_type FindBuiltInFormat(const char *logformatName)
Definition Config.cc:52
char * logfile_daemon
File path to logging daemon executable.
Definition Config.h:44
void dumpFormats(StoreEntry *e, const char *name)
Definition Config.h:38
void parseFormats()
Definition Config.cc:104
bool hasIcapToken
Definition Config.h:54
::Format::Format * findCustomFormat(const char *logformatName) const
Definition Config.cc:87
bool hasAdaptToken
Definition Config.h:50
::Format::Format * logformats
Linked list of custom log formats.
Definition Config.h:47
@ CLF_UNKNOWN
Definition Formats.h:27
Definition Config.h:18
LogConfig TheConfig
Definition Config.cc:15