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

@ -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}}
* [GetMemoryInfo][rpc getmemoryinfo]: {{summary_getMemoryInfo}} {{DASH_UPDATED0_14_1}} {{NEW_14_0}}
* [Help][rpc help]: {{summary_help}}
* [Logging][rpc logging]: {{summary_logging}} {{DASH_NEW0_14_1}}
* [Stop][rpc stop]: {{summary_stop}}
* [Uptime][rpc uptime]: {{summary_uptime}}

View file

@ -35,6 +35,8 @@ Result:
Debug mode: net+mempool
{% endhighlight %}
*See also: none*
*See also*
* [Logging][rpc logging]: {{summary_logging}}
{% 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 %}