11#ifndef SQUID_SRC_DEBUG_MESSAGES_H
12#define SQUID_SRC_DEBUG_MESSAGES_H
56 uint64_t
limit = std::numeric_limits<uint64_t>::max();
71 typedef std::array<DebugMessage, DebugMessageIdUpperBound>
Storage;
80template <DebugMessageId
id>
84 static_assert(
id > 0,
"debugs() message ID must be positive");
87 return (configured->messages)[id].currentLevel(defaultLevel);
92#define Critical(id) DebugMessageLevel<id>(DBG_CRITICAL)
93#define Important(id) DebugMessageLevel<id>(DBG_IMPORTANT)
94#define Dbg(id, defaultLevel) DebugMessageLevel<id>(defaultLevel)
manages configurable aspects of a debugs() message
bool configured() const
whether the logging of this message has been customized
int currentLevel(const int defaultLevel) const
uint64_t limit
logging attempts beyond this limit are logged at the DBG_DATA level
bool limited() const
whether the number of logging attempts have been limited
uint64_t count_
the total number of attempts to log this message if it was configured()
bool levelled() const
whether the default logging level of this message has been altered
int level
debugging level (i.e., the second debugs() parameter) or -1
a collection of DebugMessage objects (with fast access by message IDs)
std::array< DebugMessage, DebugMessageIdUpperBound > Storage
configurable messages indexed by their IDs
A const & max(A const &lhs, A const &rhs)
constexpr DebugMessageId DebugMessageIdUpperBound
The maximum used DebugMessage::id plus 1. Increase as you add new IDs.
int DebugMessageLevel(const int defaultLevel)
DebugMessages * DebugMessagesConfig
Global configuration for DebugMessageLevel() (where/when supported).
size_t DebugMessageId
an identifier for messages supporting configuration via cache_log_message