Skip to content

Commit

Permalink
Merge pull request #397 from evoskuil/master
Browse files Browse the repository at this point in the history
Add application_defined level, disable log_log logging.
  • Loading branch information
evoskuil authored May 8, 2024
2 parents 0ec5736 + ef2110d commit cddeec3
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 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
12 changes: 6 additions & 6 deletions install-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ unpack_from_tarball()
local COMPRESSION=$3
local BUILD=$4

display_heading_message "Prepairing to aquire $ARCHIVE"
display_heading_message "Preparing to acquire $ARCHIVE"

if [[ ! ($BUILD) ]]; then
display_message "Skipping unpack of $ARCHIVE..."
Expand Down Expand Up @@ -576,7 +576,7 @@ build_from_tarball()
return
fi

display_heading_message "Prepairing to build $ARCHIVE"
display_heading_message "Preparing to build $ARCHIVE"

# Because ICU tools don't know how to locate internal dependencies.
if [[ ($ARCHIVE == "$ICU_ARCHIVE") ]]; then
Expand Down Expand Up @@ -634,7 +634,7 @@ create_from_github()

FORK="$ACCOUNT/$REPO"

display_heading_message "Prepairing to aquire $FORK/$BRANCH"
display_heading_message "Preparing to acquire $FORK/$BRANCH"

if [[ -d "$REPO" ]]; then
if [[ true ]]; then
Expand Down Expand Up @@ -669,7 +669,7 @@ build_from_github()
# Join generated and command line options.
local CONFIGURATION=("${OPTIONS[@]}" "$@")

display_heading_message "Prepairing to build $REPO"
display_heading_message "Preparing to build $REPO"

# Build the local repository clone.
make_project_directory "$REPO" "$JOBS" "$TEST" "${CONFIGURATION[@]}"
Expand Down Expand Up @@ -737,7 +737,7 @@ build_from_github_cmake()
# Join generated and command line options.
local CONFIGURATION=("${OPTIONS[@]}" "$@")

display_heading_message "Prepairing to build $REPO"
display_heading_message "Preparing to build $REPO"

# Build the local repository clone.
cmake_project_directory "$REPO" "$JOBS" "$TEST" "${CONFIGURATION[@]}"
Expand Down Expand Up @@ -823,7 +823,7 @@ build_from_tarball_boost()
return
fi

display_heading_message "Prepairing to build $ARCHIVE"
display_heading_message "Preparing to build $ARCHIVE"

local TARGET="build-$ARCHIVE"

Expand Down
12 changes: 6 additions & 6 deletions install-cmakepresets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ unpack_from_tarball()
local COMPRESSION=$3
local BUILD=$4

display_heading_message "Prepairing to aquire $ARCHIVE"
display_heading_message "Preparing to acquire $ARCHIVE"

if [[ ! ($BUILD) ]]; then
display_message "Skipping unpack of $ARCHIVE..."
Expand Down Expand Up @@ -628,7 +628,7 @@ build_from_tarball()
return
fi

display_heading_message "Prepairing to build $ARCHIVE"
display_heading_message "Preparing to build $ARCHIVE"

# Because ICU tools don't know how to locate internal dependencies.
if [[ ($ARCHIVE == "$ICU_ARCHIVE") ]]; then
Expand Down Expand Up @@ -686,7 +686,7 @@ create_from_github()

FORK="$ACCOUNT/$REPO"

display_heading_message "Prepairing to aquire $FORK/$BRANCH"
display_heading_message "Preparing to acquire $FORK/$BRANCH"

if [[ -d "$REPO" ]]; then
if [[ true ]]; then
Expand Down Expand Up @@ -721,7 +721,7 @@ build_from_github()
# Join generated and command line options.
local CONFIGURATION=("${OPTIONS[@]}" "$@")

display_heading_message "Prepairing to build $REPO"
display_heading_message "Preparing to build $REPO"

# Build the local repository clone.
make_project_directory "$REPO" "$JOBS" "$TEST" "${CONFIGURATION[@]}"
Expand Down Expand Up @@ -797,7 +797,7 @@ build_from_github_cmake()
# Join generated and command line options.
local CONFIGURATION=("${OPTIONS[@]}" "$@")

display_heading_message "Prepairing to build $REPO"
display_heading_message "Preparing to build $REPO"

# Build the local repository clone.
cmake_project_directory "$REPO" "$PRESET" "$JOBS" "$TEST" "${CONFIGURATION[@]}"
Expand Down Expand Up @@ -883,7 +883,7 @@ build_from_tarball_boost()
return
fi

display_heading_message "Prepairing to build $ARCHIVE"
display_heading_message "Preparing to build $ARCHIVE"

local TARGET="build-$ARCHIVE"

Expand Down
10 changes: 5 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ unpack_from_tarball()
local COMPRESSION=$3
local BUILD=$4

display_heading_message "Prepairing to aquire $ARCHIVE"
display_heading_message "Preparing to acquire $ARCHIVE"

if [[ ! ($BUILD) ]]; then
display_message "Skipping unpack of $ARCHIVE..."
Expand Down Expand Up @@ -519,7 +519,7 @@ build_from_tarball()
return
fi

display_heading_message "Prepairing to build $ARCHIVE"
display_heading_message "Preparing to build $ARCHIVE"

# Because ICU tools don't know how to locate internal dependencies.
if [[ ($ARCHIVE == "$ICU_ARCHIVE") ]]; then
Expand Down Expand Up @@ -577,7 +577,7 @@ create_from_github()

FORK="$ACCOUNT/$REPO"

display_heading_message "Prepairing to aquire $FORK/$BRANCH"
display_heading_message "Preparing to acquire $FORK/$BRANCH"

if [[ -d "$REPO" ]]; then
if [[ true ]]; then
Expand Down Expand Up @@ -612,7 +612,7 @@ build_from_github()
# Join generated and command line options.
local CONFIGURATION=("${OPTIONS[@]}" "$@")

display_heading_message "Prepairing to build $REPO"
display_heading_message "Preparing to build $REPO"

# Build the local repository clone.
make_project_directory "$REPO" "$JOBS" "$TEST" "${CONFIGURATION[@]}"
Expand Down Expand Up @@ -698,7 +698,7 @@ build_from_tarball_boost()
return
fi

display_heading_message "Prepairing to build $ARCHIVE"
display_heading_message "Preparing to build $ARCHIVE"

local TARGET="build-$ARCHIVE"

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 cddeec3

Please sign in to comment.