mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-09 02:59:31 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user