Squid Web Cache master
Loading...
Searching...
No Matches
LogTags.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_LOGTAGS_H
10#define SQUID_SRC_LOGTAGS_H
11
12#include "CollapsingHistory.h"
13
18{
19public:
21 static LogTagsErrors FromErrno(int errNo);
22
25 void update(const LogTagsErrors &other);
26
27 bool ignored = false;
28 bool timedout = false;
29 bool aborted = false;
30};
31
68
70{
71public:
72 LogTags() = default;
73 explicit LogTags(const LogTags_ot t) { update(t); }
74
75 void update(const LogTags_ot t);
76
78 const char *c_str() const;
79
81 bool isTcpHit() const;
82
84 const char *cacheStatusSource() const;
85
88
89private:
91 static const char *Str_[];
92
93public: // XXX: only until client_db.cc stats are redesigned.
94
99};
100
103{
104 int tmp = (int)aLogType;
105 aLogType = (LogTags_ot)(++tmp);
106 return aLogType;
107}
108
109#endif /* SQUID_SRC_LOGTAGS_H */
110
LogTags_ot & operator++(LogTags_ot &aLogType)
iterator for LogTags_ot enumeration
Definition LogTags.h:102
LogTags_ot
Definition LogTags.h:40
@ LOG_TCP_REFRESH_FAIL_ERR
Definition LogTags.h:46
@ LOG_TCP_DENIED
Definition LogTags.h:55
@ LOG_TCP_REFRESH
Definition LogTags.h:48
@ LOG_UDP_MISS_NOFETCH
Definition LogTags.h:64
@ LOG_TCP_NEGATIVE_HIT
Definition LogTags.h:53
@ LOG_TCP_REFRESH_MODIFIED
Definition LogTags.h:47
@ LOG_TCP_REDIRECT
Definition LogTags.h:58
@ LOG_TCP_OFFLINE_HIT
Definition LogTags.h:57
@ LOG_TCP_HIT
Definition LogTags.h:42
@ LOG_TCP_REFRESH_FAIL_OLD
Definition LogTags.h:45
@ LOG_UDP_DENIED
Definition LogTags.h:62
@ LOG_TCP_MISS
Definition LogTags.h:43
@ LOG_TCP_MEM_HIT
Definition LogTags.h:54
@ LOG_TCP_IMS_HIT
Definition LogTags.h:50
@ LOG_UDP_HIT
Definition LogTags.h:60
@ LOG_TCP_TUNNEL
an attempt to establish a bidirectional TCP tunnel
Definition LogTags.h:59
@ LOG_ICP_QUERY
Definition LogTags.h:65
@ LOG_TAG_NONE
Definition LogTags.h:41
@ LOG_TYPE_MAX
Definition LogTags.h:66
@ LOG_TCP_REFRESH_UNMODIFIED
Definition LogTags.h:44
@ LOG_TCP_DENIED_REPLY
Definition LogTags.h:56
@ LOG_TCP_SWAPFAIL_MISS
Definition LogTags.h:52
@ LOG_UDP_MISS
Definition LogTags.h:61
@ LOG_UDP_INVALID
Definition LogTags.h:63
@ LOG_TCP_CLIENT_REFRESH_MISS
Definition LogTags.h:49
@ LOG_TCP_INM_HIT
Definition LogTags.h:51
collapsed forwarding history of a master transaction
bool aborted
_ABORTED: other abnormal termination (e.g., I/O error)
Definition LogTags.h:29
void update(const LogTagsErrors &other)
Definition LogTags.cc:14
bool timedout
_TIMEDOUT: terminated due to a lifetime or I/O timeout
Definition LogTags.h:28
bool ignored
_IGNORED: the response was not used for anything
Definition LogTags.h:27
static LogTagsErrors FromErrno(int errNo)
constructs an object matching errno(3) of a failed I/O call
Definition LogTags.cc:22
LogTags(const LogTags_ot t)
Definition LogTags.h:73
const char * c_str() const
compute the status access.log field
Definition LogTags.cc:75
const char * cacheStatusSource() const
Definition LogTags.cc:124
void update(const LogTags_ot t)
Definition LogTags.cc:63
LogTagsErrors err
various problems augmenting the primary log tag
Definition LogTags.h:87
static const char * Str_[]
list of string representations for LogTags_ot
Definition LogTags.h:33
CollapsingHistory collapsingHistory
controls CF tag presence
Definition LogTags.h:98
LogTags_ot oldType
a set of client protocol, cache use, and other transaction outcome tags
Definition LogTags.h:96
LogTags()=default
bool isTcpHit() const
determine if the log tag code indicates a cache HIT
Definition LogTags.cc:110
int unsigned int
Definition stub_fd.cc:19