lightning icon indicating copy to clipboard operation
lightning copied to clipboard

document CLN_PLUGIN_LOG behavior

Open chrisguida opened this issue 1 year ago • 2 comments

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.

chrisguida avatar Dec 08 '23 19:12 chrisguida

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.

w3irdrobot avatar Jul 12 '24 02:07 w3irdrobot

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.

chrisguida avatar Sep 29 '24 18:09 chrisguida