diff options
author | Determinant <[email protected]> | 2018-08-07 20:41:53 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2018-08-07 20:41:53 -0400 |
commit | e41eef9d19fe3a3ab9b158c985b180a3f76f93f7 (patch) | |
tree | a850f333812383b192ff35d1fbf92fcd27ae512d /include/hotstuff/util.h | |
parent | 062a1368abaa44585dcc4ea9b11e46708dbb418c (diff) |
fix bugs
Diffstat (limited to 'include/hotstuff/util.h')
-rw-r--r-- | include/hotstuff/util.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/hotstuff/util.h b/include/hotstuff/util.h index 99b5ea4..25dda70 100644 --- a/include/hotstuff/util.h +++ b/include/hotstuff/util.h @@ -9,13 +9,25 @@ namespace hotstuff { class Logger: public salticidae::Logger { public: using salticidae::Logger::Logger; + + void proto(const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + write("proto", fmt, ap); + va_end(ap); + } }; extern Logger logger; +#ifdef HOTSTUFF_PROTO_LOG +#define HOTSTUFF_ENABLE_LOG_PROTO +#endif + #ifdef HOTSTUFF_DEBUG_LOG #define HOTSTUFF_NORMAL_LOG #define HOTSTUFF_ENABLE_LOG_DEBUG +#define HOTSTUFF_ENABLE_LOG_PROTO #endif #ifdef HOTSTUFF_NORMAL_LOG @@ -41,6 +53,12 @@ extern Logger logger; #define HOTSTUFF_LOG_WARN(...) ((void)0) #endif +#ifdef HOTSTUFF_ENABLE_LOG_PROTO +#define HOTSTUFF_LOG_PROTO(...) hotstuff::logger.proto(__VA_ARGS__) +#else +#define HOTSTUFF_LOG_PROTO(...) ((void)0) +#endif + #define HOTSTUFF_LOG_ERROR(...) hotstuff::logger.error(__VA_ARGS__) #ifdef HOTSTUFF_BLK_PROFILE |