Skip to content

Commit

Permalink
Define LOGA().
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed May 9, 2024
1 parent ae2523c commit db7ca2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions include/bitcoin/network/define.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#if !defined(NDEBUG)
#define WITH_LOGO
#endif
#define WITH_LOGA
#define WITH_LOGN
#define WITH_LOGS
#define WITH_LOGP
Expand All @@ -67,6 +68,10 @@
#define HAVE_LOGO
#endif

#if defined(WITH_LOGA)
#define HAVE_LOGA
#endif

/// News (general progression).
#if defined(WITH_LOGN)
#define HAVE_LOGN
Expand Down
10 changes: 8 additions & 2 deletions include/bitcoin/network/log/levels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ enum : uint8_t
};

#if defined(HAVE_LOGGING)
constexpr auto application_defined = true;
#define LOG_ONLY(name) name
#define LOG(level_, message) \
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT) \
Expand All @@ -53,7 +52,6 @@ enum : uint8_t
log.write(network::levels::application) << name \
<< network::levels::level_ << std::endl;
#else
constexpr auto application_defined = false;
#define LOG_ONLY(name)
#define LOG(level, message)
#define LOG_LOG(level_, message)
Expand All @@ -70,6 +68,14 @@ enum : uint8_t
#define LOGO(message)
#endif

#if defined(HAVE_LOGA)
constexpr auto application_defined = true;
#define LOGA(message) LOG(application, message)
#else
#define LOGA(message)
constexpr auto application_defined = false;
#endif

#if defined(HAVE_LOGN)
constexpr auto news_defined = true;
#define LOGN(message) LOG(news, message)
Expand Down

0 comments on commit db7ca2a

Please sign in to comment.