aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-04-12 17:48:58 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-04-12 19:57:22 +0200
commit350b22497c7ce8afea8ebf6129571056dfd11a80 (patch)
tree7ad3a55dbfd7b49110dd78fea5c647232c50daa8 /src/util.cpp
parentb44adf92342ad4f9c343ba29c081a91687932936 (diff)
parent7fd50c3b70397c0dc39093a7a4ddbf9b36a615cf (diff)
downloadbitcoin-350b22497c7ce8afea8ebf6129571056dfd11a80.tar.xz
Merge #10150: [rpc] Add logging rpc
7fd50c3 allow libevent logging to be updated during runtime (John Newbery) 5255aca [rpc] Add logging RPC (John Newbery) 4d9950d Set BCLog::LIBEVENT correctly for old libevent versions. (John Newbery) Tree-SHA512: d6788a7205372c0528da71eca052910dfb055f2940ca884f422ff3db66e23a2b49c6a15b8f27d5255554fe5c5a928f5dd903fdc63b0bd6c8fa7783e77bb30fe8
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 5473799289..0dc203cba5 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -118,7 +118,7 @@ bool fLogIPs = DEFAULT_LOGIPS;
std::atomic<bool> fReopenDebugLog(false);
CTranslationInterface translationInterface;
-/** Log categories bitfield. Leveldb/libevent need special handling if their flags are changed at runtime. */
+/** Log categories bitfield. */
std::atomic<uint32_t> logCategories(0);
/** Init OpenSSL library multithreading support */
@@ -295,6 +295,21 @@ std::string ListLogCategories()
return ret;
}
+std::vector<CLogCategoryActive> ListActiveLogCategories()
+{
+ std::vector<CLogCategoryActive> ret;
+ for (unsigned int i = 0; i < ARRAYLEN(LogCategories); i++) {
+ // Omit the special cases.
+ if (LogCategories[i].flag != BCLog::NONE && LogCategories[i].flag != BCLog::ALL) {
+ CLogCategoryActive catActive;
+ catActive.category = LogCategories[i].category;
+ catActive.active = LogAcceptCategory(LogCategories[i].flag);
+ ret.push_back(catActive);
+ }
+ }
+ return ret;
+}
+
/**
* fStartedNewLine is a state variable held by the calling context that will
* suppress printing of the timestamp when multiple calls are made that don't