aboutsummaryrefslogtreecommitdiff
path: root/src/lib/log/log.h
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-09-26 13:33:17 +1000
committerteor <teor@torproject.org>2019-09-30 22:04:03 +1000
commit25c5322dfe228178391b37fffd3333abdf57baa5 (patch)
tree87f9ceedbb88e60f821a6612c2002669da505586 /src/lib/log/log.h
parent4c88ebcf4728084cad0a1f177eb9cdb107388581 (diff)
downloadtor-25c5322dfe228178391b37fffd3333abdf57baa5.tar.gz
tor-25c5322dfe228178391b37fffd3333abdf57baa5.zip
log: Define count, boundary, and all macros for domains and flags
And do static checks on those macro definitions. Part of 31854.
Diffstat (limited to 'src/lib/log/log.h')
-rw-r--r--src/lib/log/log.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/log/log.h b/src/lib/log/log.h
index da4bcbe608..b957fd1567 100644
--- a/src/lib/log/log.h
+++ b/src/lib/log/log.h
@@ -117,10 +117,21 @@
#define LD_BTRACK (UINT64_C(1)<<28)
/** Message-passing backend. */
#define LD_MESG (UINT64_C(1)<<29)
+
+/** The number of log domains. */
#define N_LOGGING_DOMAINS 30
+/** The highest log domain */
+#define HIGHEST_RESERVED_LD_DOMAIN_ (UINT64_C(1)<<(N_LOGGING_DOMAINS - 1))
+/** All log domains. */
+#define LD_ALL_DOMAINS ((~(UINT64_C(0)))>>(64 - N_LOGGING_DOMAINS))
+/** The number of log flags. */
+#define N_LOGGING_FLAGS 3
/** First bit that is reserved in log_domain_mask_t for non-domain flags. */
-#define LOWEST_RESERVED_LD_FLAG_ (UINT64_C(1)<<61)
+#define LOWEST_RESERVED_LD_FLAG_ (UINT64_C(1)<<(64 - N_LOGGING_FLAGS))
+/** All log flags. */
+#define LD_ALL_FLAGS ((~(UINT64_C(0)))<<(64 - N_LOGGING_FLAGS))
+
#ifdef TOR_UNIT_TESTS
/** This log message should not be intercepted by mock_saving_logv */
#define LD_NO_MOCK (UINT64_C(1)<<61)