RPC - Add new logging RPC

This commit is contained in:
thephez 2019-08-22 14:05:52 -04:00
parent 83b5325668
commit 9e70a596a4
9 changed files with 166 additions and 1 deletions

View file

@ -495,6 +495,8 @@ DIP8:
'`listwallets` RPC': rpc listwallets '`listwallets` RPC': rpc listwallets
'`lockunspent`': rpc lockunspent '`lockunspent`': rpc lockunspent
'`lockunspent` RPC': rpc lockunspent '`lockunspent` RPC': rpc lockunspent
'`logging`': rpc logging
'`logging` RPC': rpc logging
'`masternode`': rpc masternode '`masternode`': rpc masternode
'`masternode` RPC': rpc masternode '`masternode` RPC': rpc masternode
'`masternodebroadcast`': rpc masternodebroadcast '`masternodebroadcast`': rpc masternodebroadcast

View file

@ -269,6 +269,7 @@ devsearches:
- 'ListUnspent': "/en/developer-reference#listunspent" - 'ListUnspent': "/en/developer-reference#listunspent"
- 'ListWallets': "/en/developer-reference#listwallets" - 'ListWallets': "/en/developer-reference#listwallets"
- 'LockUnspent': "/en/developer-reference#lockunspent" - 'LockUnspent': "/en/developer-reference#lockunspent"
- 'Logging': "/en/developer-reference#logging"
- 'Masternode': "/en/developer-reference#masternode" - 'Masternode': "/en/developer-reference#masternode"
- 'MasternodeBroadcast': "/en/developer-reference#masternodebroadcast" - 'MasternodeBroadcast': "/en/developer-reference#masternodebroadcast"
- 'MasternodeList': "/en/developer-reference#masternodelist" - 'MasternodeList': "/en/developer-reference#masternodelist"

View file

@ -155,6 +155,7 @@ These RPCs are all Dash-specific and not found in Bitcoin Core
* [GetInfo][rpc getinfo]: {{summary_getInfo}} {{DASH_UPDATED0_14_1}} {{DEPRECATED}} * [GetInfo][rpc getinfo]: {{summary_getInfo}} {{DASH_UPDATED0_14_1}} {{DEPRECATED}}
* [GetMemoryInfo][rpc getmemoryinfo]: {{summary_getMemoryInfo}} {{DASH_UPDATED0_14_1}} {{NEW_14_0}} * [GetMemoryInfo][rpc getmemoryinfo]: {{summary_getMemoryInfo}} {{DASH_UPDATED0_14_1}} {{NEW_14_0}}
* [Help][rpc help]: {{summary_help}} * [Help][rpc help]: {{summary_help}}
* [Logging][rpc logging]: {{summary_logging}} {{DASH_NEW0_14_1}}
* [Stop][rpc stop]: {{summary_stop}} * [Stop][rpc stop]: {{summary_stop}}
* [Uptime][rpc uptime]: {{summary_uptime}} * [Uptime][rpc uptime]: {{summary_uptime}}

View file

@ -35,6 +35,8 @@ Result:
Debug mode: net+mempool Debug mode: net+mempool
{% endhighlight %} {% endhighlight %}
*See also: none* *See also*
* [Logging][rpc logging]: {{summary_logging}}
{% endautocrossref %} {% endautocrossref %}

View file

@ -0,0 +1,149 @@
{% comment %}
This file is licensed under the MIT License (MIT) available on
http://opensource.org/licenses/MIT.
{% endcomment %}
{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/logging.md" %}
<!--__-->
##### Logging
{% include helpers/subhead-links.md %}
{% assign summary_logging="gets and sets the logging configuration" %}
{% autocrossref %}
The `logging` RPC {{summary_logging}}
*Parameter #1---include categories*
{% itemplate ntpd1 %}
- n: "`include`"
t: "array of strings"
p: "Optional<br>(0 or 1)"
d: "Enable debugging for these categories"
{% enditemplate %}
*Parameter #2---exclude categories*
{% itemplate ntpd1 %}
- n: "`exclude`"
t: "array of strings"
p: "Optional<br>(0 or 1)"
d: "Enable debugging for these categories"
{% enditemplate %}
The categories are:
| Type | Category |
| - | - |
| Special | • `0` - Disables all categories <br>`1` or `all` - Enables all categories <br>`dash` - Enables/disables all Dash categories |
| Standard | `addrman`, `bench` <br>`cmpctblock`, `coindb`, `db`, `estimatefee`, `http`, `leveldb`, `libevent`, `mempool`, `mempoolrej`, `net`, `proxy`, `prune`, `qt`, `rand`, `reindex`, `rpc`, `selectcoins`, `tor`, `zmq`|
| Dash | <br>`chainlocks`, `gobject`, `instantsend`, `keepass`, `llmq<!--noref-->`, `llmq<!--noref-->-dkg`, `llmq<!--noref-->-sigs`, `mnpayments`, `mnsync`, `privatesend`, `spork` |
*Result---a list of the logging categories that are active*
{% itemplate ntpd1 %}
- n: "`result`"
t: "object"
p: "Required<br>(exactly 1)"
d: "A JSON object show a list of the logging categories that are active"
{% enditemplate %}
*Example from Dash Core 0.14.1*
Include a category in logging
{% highlight bash %}
dash-cli -testnet logging '["llmq", "spork"]'
{% endhighlight %}
Result:
{% highlight json %}
{
"net": 0,
"tor": 0,
"mempool": 0,
"http": 0,
"bench": 0,
"zmq": 0,
"db": 0,
"rpc": 0,
"estimatefee": 0,
"addrman": 0,
"selectcoins": 0,
"reindex": 0,
"cmpctblock": 0,
"rand": 0,
"prune": 0,
"proxy": 0,
"mempoolrej": 0,
"libevent": 0,
"coindb": 0,
"qt": 0,
"leveldb": 0,
"chainlocks": 0,
"gobject": 0,
"instantsend": 0,
"keepass": 0,
"llmq": 1,
"llmq-dkg": 0,
"llmq-sigs": 0,
"mnpayments": 0,
"mnsync": 0,
"privatesend": 0,
"spork": 1
}
{% endhighlight %}
Excluding a previously included category (without including any new ones):
{% highlight bash %}
dash-cli -testnet logging '[]' '["spork"]'
{% endhighlight %}
Result:
{% highlight json %}
{
"net": 0,
"tor": 0,
"mempool": 0,
"http": 0,
"bench": 0,
"zmq": 0,
"db": 0,
"rpc": 0,
"estimatefee": 0,
"addrman": 0,
"selectcoins": 0,
"reindex": 0,
"cmpctblock": 0,
"rand": 0,
"prune": 0,
"proxy": 0,
"mempoolrej": 0,
"libevent": 0,
"coindb": 0,
"qt": 0,
"leveldb": 0,
"chainlocks": 0,
"gobject": 0,
"instantsend": 0,
"keepass": 0,
"llmq": 1,
"llmq-dkg": 0,
"llmq-sigs": 0,
"mnpayments": 0,
"mnsync": 0,
"privatesend": 0,
"spork": 0
}
{% endhighlight %}
*See also*
* [Debug][rpc debug]: {{summary_debug}}
{% endautocrossref %}

View file

@ -104,6 +104,7 @@ This file is licensed under the terms of its source texts{%endcomment%}
{% assign summary_listUnspent="returns an array of unspent transaction outputs belonging to this wallet." %} {% assign summary_listUnspent="returns an array of unspent transaction outputs belonging to this wallet." %}
{% assign summary_listWallets="returns a list of currently loaded wallets." %} {% assign summary_listWallets="returns a list of currently loaded wallets." %}
{% assign summary_lockUnspent="temporarily locks or unlocks specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection when spending dash. Locks are stored in memory only, so nodes start with zero locked outputs and the locked output list is always cleared when a node stops or fails." %} {% assign summary_lockUnspent="temporarily locks or unlocks specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection when spending dash. Locks are stored in memory only, so nodes start with zero locked outputs and the locked output list is always cleared when a node stops or fails." %}
{% assign summary_logging="gets and sets the logging configuration" %}
{% assign summary_masternode="provides a set of commands for managing masternodes and displaying information about them." %} {% assign summary_masternode="provides a set of commands for managing masternodes and displaying information about them." %}
{% assign summary_masternodeBroadcast="was removed in Dash Core 0.14.0." %} {% assign summary_masternodeBroadcast="was removed in Dash Core 0.14.0." %}
{% assign summary_masternodeList="returns a list of masternodes in different modes." %} {% assign summary_masternodeList="returns a list of masternodes in different modes." %}

View file

@ -235,6 +235,12 @@ th.tg-sort-header::-moz-selection { background:transparent; }th.tg-sort-header::
<td class="tg-dzk6">Y</td> <td class="tg-dzk6">Y</td>
<td class="tg-dzk6"></td> <td class="tg-dzk6"></td>
</tr> </tr>
<tr>
<td class="tg-b7b8">Control</td>
<td class="tg-b7b8"><a href="#logging">Logging</a></td>
<td class="tg-dzk6">Y</td>
<td class="tg-dzk6">Added in 0.14.1</td>
</tr>
<tr> <tr>
<td class="tg-yw4l">Control</td> <td class="tg-yw4l">Control</td>
<td class="tg-yw4l"><a href="#stop">Stop</a></td> <td class="tg-yw4l"><a href="#stop">Stop</a></td>

View file

@ -172,6 +172,7 @@ http://opensource.org/licenses/MIT.
[rpc listunspent]: /en/developer-reference#listunspent [rpc listunspent]: /en/developer-reference#listunspent
[rpc listwallets]: /en/developer-reference#listwallets [rpc listwallets]: /en/developer-reference#listwallets
[rpc lockunspent]: /en/developer-reference#lockunspent [rpc lockunspent]: /en/developer-reference#lockunspent
[rpc logging]: /en/developer-reference#logging
[rpc masternode]: /en/developer-reference#masternode [rpc masternode]: /en/developer-reference#masternode
[rpc masternodebroadcast]: /en/developer-reference#masternodebroadcast [rpc masternodebroadcast]: /en/developer-reference#masternodebroadcast
[rpc masternodelist]: /en/developer-reference#masternodelist [rpc masternodelist]: /en/developer-reference#masternodelist

View file

@ -278,6 +278,8 @@ untrusted source.
{% include devdoc/dash-core/rpcs/rpcs/lockunspent.md %} {% include devdoc/dash-core/rpcs/rpcs/lockunspent.md %}
{% include devdoc/dash-core/rpcs/rpcs/logging.md %}
{% include devdoc/dash-core/rpcs/rpcs/masternode.md %} {% include devdoc/dash-core/rpcs/rpcs/masternode.md %}
{% include devdoc/dash-core/rpcs/rpcs/masternodebroadcast.md %} {% include devdoc/dash-core/rpcs/rpcs/masternodebroadcast.md %}