LogTags.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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:
22 void update(const LogTagsErrors &other);
23
24 bool ignored = false;
25 bool timedout = false;
26 bool aborted = false;
27};
28
37typedef enum {
41 LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry
42 LOG_TCP_REFRESH_FAIL_OLD, // refresh from origin failed, stale reply sent
43 LOG_TCP_REFRESH_FAIL_ERR, // refresh from origin failed, error forwarded
44 LOG_TCP_REFRESH_MODIFIED, // refresh from origin replaced existing entry
45 LOG_TCP_REFRESH, // refresh from origin started, but still pending
65
67{
68public:
69 LogTags() = default;
70 explicit LogTags(const LogTags_ot t) { update(t); }
71
72 void update(const LogTags_ot t);
73
75 const char *c_str() const;
76
78 bool isTcpHit() const;
79
81 const char *cacheStatusSource() const;
82
85
86private:
88 static const char *Str_[];
89
90public: // XXX: only until client_db.cc stats are redesigned.
91
96};
97
100{
101 int tmp = (int)aLogType;
102 aLogType = (LogTags_ot)(++tmp);
103 return aLogType;
104}
105
106#endif
107
LogTags_ot & operator++(LogTags_ot &aLogType)
iterator for LogTags_ot enumeration
Definition: LogTags.h:99
LogTags_ot
Definition: LogTags.h:37
@ LOG_TCP_REFRESH_FAIL_ERR
Definition: LogTags.h:43
@ LOG_TCP_DENIED
Definition: LogTags.h:52
@ LOG_TCP_REFRESH
Definition: LogTags.h:45
@ LOG_UDP_MISS_NOFETCH
Definition: LogTags.h:61
@ LOG_TCP_NEGATIVE_HIT
Definition: LogTags.h:50
@ LOG_TCP_REFRESH_MODIFIED
Definition: LogTags.h:44
@ LOG_TCP_REDIRECT
Definition: LogTags.h:55
@ LOG_TCP_OFFLINE_HIT
Definition: LogTags.h:54
@ LOG_TCP_HIT
Definition: LogTags.h:39
@ LOG_TCP_REFRESH_FAIL_OLD
Definition: LogTags.h:42
@ LOG_UDP_DENIED
Definition: LogTags.h:59
@ LOG_TCP_MISS
Definition: LogTags.h:40
@ LOG_TCP_MEM_HIT
Definition: LogTags.h:51
@ LOG_TCP_IMS_HIT
Definition: LogTags.h:47
@ LOG_UDP_HIT
Definition: LogTags.h:57
@ LOG_TCP_TUNNEL
an attempt to establish a bidirectional TCP tunnel
Definition: LogTags.h:56
@ LOG_ICP_QUERY
Definition: LogTags.h:62
@ LOG_TAG_NONE
Definition: LogTags.h:38
@ LOG_TYPE_MAX
Definition: LogTags.h:63
@ LOG_TCP_REFRESH_UNMODIFIED
Definition: LogTags.h:41
@ LOG_TCP_DENIED_REPLY
Definition: LogTags.h:53
@ LOG_TCP_SWAPFAIL_MISS
Definition: LogTags.h:49
@ LOG_UDP_MISS
Definition: LogTags.h:58
@ LOG_UDP_INVALID
Definition: LogTags.h:60
@ LOG_TCP_CLIENT_REFRESH_MISS
Definition: LogTags.h:46
@ LOG_TCP_INM_HIT
Definition: LogTags.h:48
collapsed forwarding history of a master transaction
bool aborted
_ABORTED: other abnormal termination (e.g., I/O error)
Definition: LogTags.h:26
void update(const LogTagsErrors &other)
Definition: LogTags.cc:14
bool timedout
_TIMEDOUT: terminated due to a lifetime or I/O timeout
Definition: LogTags.h:25
bool ignored
_IGNORED: the response was not used for anything
Definition: LogTags.h:24
LogTags(const LogTags_ot t)
Definition: LogTags.h:70
const char * c_str() const
compute the status access.log field
Definition: LogTags.cc:66
const char * cacheStatusSource() const
Definition: LogTags.cc:115
void update(const LogTags_ot t)
Definition: LogTags.cc:54
LogTagsErrors err
various problems augmenting the primary log tag
Definition: LogTags.h:84
static const char * Str_[]
list of string representations for LogTags_ot
Definition: LogTags.h:88
CollapsingHistory collapsingHistory
controls CF tag presence
Definition: LogTags.h:95
LogTags_ot oldType
a set of client protocol, cache use, and other transaction outcome tags
Definition: LogTags.h:93
LogTags()=default
bool isTcpHit() const
determine if the log tag code indicates a cache HIT
Definition: LogTags.cc:101
int unsigned int
Definition: stub_fd.cc:19

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors