move-onlyish: Move logging levels to util/log.h

This is not strictly move-only because BCLog::Level is now defined as a type
alias for util::log::Level;

Review with --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
This commit is contained in:
stickies-v
2026-01-21 18:11:38 +00:00
parent 56d113cab0
commit 94c0adf4e8
2 changed files with 14 additions and 7 deletions

View File

@@ -63,13 +63,6 @@ struct LogCategory {
};
namespace BCLog {
enum class Level {
Trace = 0, // High-volume or detailed logging for development/debugging
Debug, // Reasonably noisy logging, but still usable in production
Info, // Default
Warning,
Error,
};
constexpr auto DEFAULT_LOG_LEVEL{Level::Debug};
constexpr size_t DEFAULT_MAX_LOG_BUFFER{1'000'000}; // buffer up to 1MB of log data prior to StartLogging
constexpr uint64_t RATELIMIT_MAX_BYTES{1024 * 1024}; // maximum number of bytes per source location that can be logged within the RATELIMIT_WINDOW

View File

@@ -29,4 +29,18 @@ private:
std::source_location m_loc;
};
namespace util::log {
enum class Level {
Trace = 0, // High-volume or detailed logging for development/debugging
Debug, // Reasonably noisy logging, but still usable in production
Info, // Default
Warning,
Error,
};
} // namespace util::log
namespace BCLog {
//! Alias for compatibility. Prefer util::log::Level over BCLog::Level in new code.
using Level = util::log::Level;
} // namespace BCLog
#endif // BITCOIN_UTIL_LOG_H