mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
e92b710406
We always hand in "NULL" (which means use tal_len on the msg), except for two places which do that manually for no good reason. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
23 lines
533 B
C
23 lines
533 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;
|
|
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, &data)) {
|
|
if (level == LOG_IO_IN || level == LOG_IO_OUT) {
|
|
log_io(log, level, "", data, tal_len(data));
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|