lightning
lightning copied to clipboard
document CLN_PLUGIN_LOG behavior
It's not at all intuitive how to make log::debug! and log::trace! messages appear in the CLN log when sent from a plugin using the Rust cln-plugin library.
I finally figured out how to do it: https://github.com/chrisguida/smaug/issues/34
We should document this somewhere.
There isn't any documentation at the top level of the crate. This could be a good candidate for something that should be in that sort of docs.
One thing I've noticed is that logs that help determine why the plugin crashed often don't make it into the CLN log even if all the logging is on, because CLN will just drop any logs from dead plugins, even logs that might help diagnose why the plugin died.
To get around this, I've started just printing things directly to stderr, which appears to always work.