2018-02-08 02:25:12 +01:00
|
|
|
#include <common/gen_status_wire.h>
|
2018-02-05 05:09:27 +01:00
|
|
|
#include <lightningd/log_status.h>
|
|
|
|
|
|
|
|
bool log_status_msg(struct log *log, const u8 *msg)
|
|
|
|
{
|
2018-05-10 01:18:24 +02:00
|
|
|
char *entry, *who;
|
2018-02-08 02:25:12 +01:00
|
|
|
u8 *data;
|
|
|
|
enum log_level level;
|
2018-02-05 05:09:27 +01:00
|
|
|
|
2018-02-20 21:59:09 +01:00
|
|
|
if (fromwire_status_log(msg, msg, &level, &entry)) {
|
2018-02-08 02:25:12 +01:00
|
|
|
if (level != LOG_IO_IN && level != LOG_IO_OUT) {
|
|
|
|
log_(log, level, "%s", entry);
|
|
|
|
return true;
|
|
|
|
}
|
2018-05-10 01:18:24 +02:00
|
|
|
} else if (fromwire_status_io(msg, msg, &level, &who, &data)) {
|
2018-02-08 02:25:12 +01:00
|
|
|
if (level == LOG_IO_IN || level == LOG_IO_OUT) {
|
2018-05-10 01:18:24 +02:00
|
|
|
log_io(log, level, who, data, tal_len(data));
|
2018-02-08 02:25:12 +01:00
|
|
|
return true;
|
2018-02-05 05:09:27 +01:00
|
|
|
}
|
|
|
|
}
|
2018-02-08 02:25:12 +01:00
|
|
|
return false;
|
2018-02-05 05:09:27 +01:00
|
|
|
}
|