Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugin_log_handle: accommodate multi-line messages
Previously, the code utilized JSON-encoded text to pass log messages to the log_() function, resulting in new lines being printed to the log as '\n'. This commit addresses this issue by unescaping and splitting the log message into lines, with each non-empty line being logged separately. It is deemed acceptable to pass non-printable characters to log_() since they are replaced with "?" in the logv() function, invoked by log_(). Therefore, leaving lines JSON unescaped is permissible. It's important to note that only the last log_() call may have call_notifier set to true. This adjustment is crucial to prevent Python tracebacks complaining about a broken pipe after lightningd exits. Fix ElementsProject#4912 For reference, the log of lightningd failing without a backend: ./lightningd/lightningd 2024-02-08T20:33:17.642Z INFO lightningd: v23.11-257-g968d6d6-modded Could not connect to bitcoind using bitcoin-cli. Is bitcoind running? Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind. You can verify that your Bitcoin Core installation is ready for use by running: $ bitcoin-cli echo 'hello world' 2024-02-08T20:33:18.227Z **BROKEN** plugin-bcli: Could not connect to bitcoind using bitcoin-cli. Is bitcoind running? 2024-02-08T20:33:18.227Z **BROKEN** plugin-bcli: Make sure you have bitcoind running and that bitcoin-cli is able to connect to bitcoind. 2024-02-08T20:33:18.227Z **BROKEN** plugin-bcli: You can verify that your Bitcoin Core installation is ready for use by running: 2024-02-08T20:33:18.227Z **BROKEN** plugin-bcli: $ bitcoin-cli echo 'hello world' 2024-02-08T20:33:18.227Z INFO plugin-bcli: Killing plugin: exited before we sent init The Bitcoin backend died.
- Loading branch information