aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/logging.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-12-07 12:58:58 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-12-07 14:06:34 +0100
commit703d863a48f549b2626382eda407ffae779f8725 (patch)
treee38d101d192accd9099a5f0d0aaf8ff14c4ca0f3 /src/libutil/logging.hh
parentc4a6113800dd3aa4eb95b74853c844331af82f1e (diff)
Trivial changes from the lazy-trees branch
Diffstat (limited to 'src/libutil/logging.hh')
-rw-r--r--src/libutil/logging.hh8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libutil/logging.hh b/src/libutil/logging.hh
index d0817b4a9..4642c49f7 100644
--- a/src/libutil/logging.hh
+++ b/src/libutil/logging.hh
@@ -82,7 +82,7 @@ public:
log(lvlInfo, fs);
}
- virtual void logEI(const ErrorInfo &ei) = 0;
+ virtual void logEI(const ErrorInfo & ei) = 0;
void logEI(Verbosity lvl, ErrorInfo ei)
{
@@ -225,7 +225,11 @@ inline void warn(const std::string & fs, const Args & ... args)
logger->warn(f.str());
}
-void warnOnce(bool & haveWarned, const FormatOrString & fs);
+#define warnOnce(haveWarned, args...) \
+ if (!haveWarned) { \
+ haveWarned = true; \
+ warn(args); \
+ }
void writeToStderr(std::string_view s);