mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Create BCLog::Logger::LogLevelsString() helper function
Co-authored-by: "Jon Atack <jon@atack.com>"
This commit is contained in:
@@ -319,6 +319,18 @@ std::vector<LogCategory> BCLog::Logger::LogCategoriesList() const
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Log severity levels that can be selected by the user. */
|
||||||
|
static constexpr std::array<BCLog::Level, 2> LogLevelsList()
|
||||||
|
{
|
||||||
|
return {BCLog::Level::Info, BCLog::Level::Debug};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string BCLog::Logger::LogLevelsString() const
|
||||||
|
{
|
||||||
|
const auto& levels = LogLevelsList();
|
||||||
|
return Join(std::vector<BCLog::Level>{levels.begin(), levels.end()}, ", ", [this](BCLog::Level level) { return LogLevelToStr(level); });
|
||||||
|
}
|
||||||
|
|
||||||
std::string BCLog::Logger::LogTimestampStr(const std::string& str)
|
std::string BCLog::Logger::LogTimestampStr(const std::string& str)
|
||||||
{
|
{
|
||||||
std::string strStamped;
|
std::string strStamped;
|
||||||
|
|||||||
@@ -186,6 +186,9 @@ namespace BCLog {
|
|||||||
return Join(LogCategoriesList(), ", ", [&](const LogCategory& i) { return i.category; });
|
return Join(LogCategoriesList(), ", ", [&](const LogCategory& i) { return i.category; });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! Returns a string with all user-selectable log levels.
|
||||||
|
std::string LogLevelsString() const;
|
||||||
|
|
||||||
bool DefaultShrinkDebugFile() const;
|
bool DefaultShrinkDebugFile() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user