Skip to content

Commit

Permalink
Add application_defined level, disable log_log logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed May 8, 2024
1 parent 6aa6615 commit ef2110d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions include/bitcoin/network/log/levels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ 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 @@ -52,6 +53,7 @@ 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 Down
21 changes: 11 additions & 10 deletions src/p2p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,17 @@ p2p::p2p(const settings& settings, const logger& log) NOEXCEPT
{
BC_ASSERT_MSG(!is_zero(settings.threads), "empty threadpool");

LOG_LOG("News logging compiled....: ", news_defined);
LOG_LOG("Session logging compiled.: ", session_defined);
LOG_LOG("Protocol logging compiled: ", protocol_defined);
LOG_LOG("ProXy logging compiled...: ", proxy_defined);
LOG_LOG("Wire logging compiled....: ", wire_defined);
LOG_LOG("Remote logging compiled..: ", remote_defined);
LOG_LOG("Fault logging compiled...: ", fault_defined);
LOG_LOG("Quit logging compiled....: ", quit_defined);
LOG_LOG("Object logging compiled..: ", objects_defined);
LOG_LOG("Verbose logging compiled.: ", verbose_defined);
////LOG_LOG("Aplication log compiled..: ", news_defined);
////LOG_LOG("News log compiled........: ", news_defined);
////LOG_LOG("Session log compiled.....: ", session_defined);
////LOG_LOG("Protocol log compiled....: ", protocol_defined);
////LOG_LOG("ProXy log compiled.......: ", proxy_defined);
////LOG_LOG("Wire log compiled........: ", wire_defined);
////LOG_LOG("Remote log compiled......: ", remote_defined);
////LOG_LOG("Fault log compiled.......: ", fault_defined);
////LOG_LOG("Quit log compiled........: ", quit_defined);
////LOG_LOG("Object log compiled......: ", objects_defined);
////LOG_LOG("Verbose log compiled.....: ", verbose_defined);
}

p2p::~p2p() NOEXCEPT
Expand Down

0 comments on commit ef2110d

Please sign in to comment.