mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
log: Use Join() helper when listing log categories
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <fs.h>
|
||||
#include <tinyformat.h>
|
||||
#include <util/string.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
@@ -24,8 +25,7 @@ extern const char * const DEFAULT_DEBUGLOGFILE;
|
||||
|
||||
extern bool fLogIPs;
|
||||
|
||||
struct CLogCategoryActive
|
||||
{
|
||||
struct LogCategory {
|
||||
std::string category;
|
||||
bool active;
|
||||
};
|
||||
@@ -132,6 +132,13 @@ namespace BCLog {
|
||||
bool DisableCategory(const std::string& str);
|
||||
|
||||
bool WillLogCategory(LogFlags category) const;
|
||||
/** Returns a vector of the log categories */
|
||||
std::vector<LogCategory> LogCategoriesList();
|
||||
/** Returns a string with the log categories */
|
||||
std::string LogCategoriesString()
|
||||
{
|
||||
return Join(LogCategoriesList(), ", ", [&](const LogCategory& i) { return i.category; });
|
||||
};
|
||||
|
||||
bool DefaultShrinkDebugFile() const;
|
||||
};
|
||||
@@ -146,12 +153,6 @@ static inline bool LogAcceptCategory(BCLog::LogFlags category)
|
||||
return LogInstance().WillLogCategory(category);
|
||||
}
|
||||
|
||||
/** Returns a string with the log categories. */
|
||||
std::string ListLogCategories();
|
||||
|
||||
/** Returns a vector of the active log categories. */
|
||||
std::vector<CLogCategoryActive> ListActiveLogCategories();
|
||||
|
||||
/** Return true if str parses as a log category and set the flag */
|
||||
bool GetLogCategory(BCLog::LogFlags& flag, const std::string& str);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user