// (trace-regexp). We feed an OptLog object to the code that should not know anything about this
// That code shold then log using VLOG
-struct LogVariant {
+struct LogVariant
+{
string prefix;
// variant cannot hold references
std::variant<Logger*, ostringstream*> v;
// Originally there was a flag but is was never set from !RECURSOR
#define VLOG(log, x) #error VLOG only works in recursor
#else
-#define VLOG(log, x) \
- if (log) { \
- if (std::holds_alternative<Logger*>((log)->v)) { \
+#define VLOG(log, x) \
+ if (log) { \
+ if (std::holds_alternative<Logger*>((log)->v)) { \
*std::get<Logger*>(log->v) << Logger::Warning << (log)->prefix << x; \
- } \
- else if (std::holds_alternative<ostringstream*>((log)->v)) { \
- *std::get<ostringstream*>((log)->v) << (log)->prefix << x; \
- } \
+ } \
+ else if (std::holds_alternative<ostringstream*>((log)->v)) { \
+ *std::get<ostringstream*>((log)->v) << (log)->prefix << x; \
+ } \
}
#endif
-
unsigned int SyncRes::s_max_busy_dot_probes;
bool SyncRes::s_addExtendedResolutionDNSErrors;
-#define LOG(x) \
- if (d_lm == Log) { \
- g_log << Logger::Warning << x; \
- } \
- else if (d_lm == Store) { \
- d_trace << x; \
+#define LOG(x) \
+ if (d_lm == Log) { \
+ g_log << Logger::Warning << x; \
+ } \
+ else if (d_lm == Store) { \
+ d_trace << x; \
}
OptLog SyncRes::LogObject(const string& prefix)
if (d_lm == Log) {
ret = {prefix, &g_log};
}
- else if(d_lm == Store) {
+ else if (d_lm == Store) {
ret = {prefix, &d_trace};
}
return ret;