mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
5cf34d6618
tal_count() is used where there's a type, even if it's char or u8, and tal_bytelen() is going to replace tal_len() for clarity: it's only needed where a pointer is void. We shim tal_bytelen() for now. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
23 lines
548 B
C
23 lines
548 B
C
#include <common/gen_status_wire.h>
|
|
#include <lightningd/log_status.h>
|
|
|
|
bool log_status_msg(struct log *log, const u8 *msg)
|
|
{
|
|
char *entry, *who;
|
|
u8 *data;
|
|
enum log_level level;
|
|
|
|
if (fromwire_status_log(msg, msg, &level, &entry)) {
|
|
if (level != LOG_IO_IN && level != LOG_IO_OUT) {
|
|
log_(log, level, "%s", entry);
|
|
return true;
|
|
}
|
|
} else if (fromwire_status_io(msg, msg, &level, &who, &data)) {
|
|
if (level == LOG_IO_IN || level == LOG_IO_OUT) {
|
|
log_io(log, level, who, data, tal_count(data));
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|