core-lightning/contrib
Christian Decker 556725c5ff pyln: Add logging handler that passes records to lightningd
It is often pretty usefuk to use the builtin logging module to debug things,
including libraries that a plugin may use. This adds a simple
`PluginLogHandler` that maps the python logging levels to the `lightningd`
logging levels, and formats the record in a way that it doesn't clutter up the
`lightningd` logs (no duplicate timestamps and levels).

This allow us to tweak the log level that is reported to `lightningd` simply
using the following

```python3
import logging
logging.basicConfig(level=logging.DEBUG)
```

Notice that in order for the logs to be displayed on the terminal or the
logfile, both the logging level in the plugin _and_ the `--log-level`
`lightningd` is running need to be adjusted (the python logging level only
controls which messages get forwarded to `lightningd`, it does not have the
power to overrule `lightningd` about what to actually display).

I chose `logging.INFO` as the default, since libraries have a tendency to spew
out everything in `logging.DEBUG` mode

Changelog-Added: pyln: Plugins have been integrated with the `logging` module for easier debugging and error reporting.
2020-10-13 20:52:14 +02:00
..
init systemd: After=network-online.target 2019-08-20 20:14:36 +02:00
plugins JSON-RPC: getmanifest passes allow-deprecated-apis flag. 2020-08-11 08:43:18 +09:30
pylightning pyln: Add unit tests from pyln-* to make check-python 2020-02-01 16:50:58 +01:00
pyln-client pyln: Add logging handler that passes records to lightningd 2020-10-13 20:52:14 +02:00
pyln-proto pyln: Add type-annotations to pyln-proto 2020-09-28 09:19:46 +09:30
pyln-spec pyln-proto, pyln-spec: fix 'make prod-release' target. 2020-06-29 18:01:12 +02:00
pyln-testing pytest: fix overzealous removal of directories on failure. 2020-10-13 17:33:49 +02:00
reprobuild repro: Add missing Dockerfiles 2020-09-16 06:27:12 +09:30
sanitizer_suppressions configure: allow to run clang with ASAN 2020-09-24 13:57:43 +09:30
bootstrap-node.sh contrib: add executable flag for bootstrap-node.sh 2020-05-05 13:27:55 +09:30
Dockerfile.builder build: add mkrd to docker install? 2020-04-19 08:07:47 +09:30
Dockerfile.builder.fedora build: add mkrd to docker install? 2020-04-19 08:07:47 +09:30
lightning-cli.bash-completion Fix bash completion. 2020-05-15 15:25:33 +02:00
linuxarm32v7.Dockerfile Add python to runtime docker image (arm32/64) 2020-08-24 20:23:25 +02:00
linuxarm64v8.Dockerfile Add python to runtime docker image (arm32/64) 2020-08-24 20:23:25 +02:00
short_channel_id-to-txid.sh Add compability to current formalism to short_channel_id-to-txid.sh 2019-10-04 00:38:52 +00:00
startup_regtest.sh contrib: make bitcoin polling and gossip propagation snappier 2020-09-17 10:14:22 +09:30