get10101 / 10101

10101 (Ten-Ten-One): Self-custodial derivative trading at your fingertips.
https://10101.finance
MIT License
128 stars 23 forks source link

Configure `rust-lightning` to emit trace logs #103

Closed luckysori closed 1 year ago

luckysori commented 1 year ago

This did work in 10101-poc.

holzeis commented 1 year ago

I don't think this worked in the 10101-poc as all rust-lightning logs where printed to debug.

https://github.com/get10101/10101-PoC/blob/7f9d4f02f93288dbe259df1414e3c484744ea4a6/rust/src/disk.rs#L67-L75

// TODO: Distinguish between the log levels instead of logging
// everything on trace
tracing::debug!(
    target: "ldk",
    ?log_level,
    module_path = record.module_path,
    line = record.line,
    raw_log
);
holzeis commented 1 year ago

We tried to configure the tracing for our single_hop_payment test. Currently it is set to debug, but trace printed all the logs except for the rust-lightning trace logs.

We suspect that the modules referenced are not correct, and depending on where the logger is called from the messages will not adhere to the defined log level.

https://github.com/get10101/10101/blob/6615b4d75cbcee6800a35c87e36b6f5a4190e682/crates/ln-dlc-node/src/tests/single_hop_payment.rs#L13-L16

https://github.com/get10101/10101/tree/ln-dlc-node-single-hop-test

holzeis commented 1 year ago

This is working on main. Closing the ticket. @Restioson thanks for fixing it.