2018-02-05 05:09:27 +01:00
|
|
|
#ifndef LIGHTNING_COMMON_STATUS_LEVELS_H
|
|
|
|
#define LIGHTNING_COMMON_STATUS_LEVELS_H
|
|
|
|
#include "config.h"
|
2020-10-12 07:33:36 +02:00
|
|
|
#include <ccan/tal/tal.h>
|
2018-02-05 05:09:27 +01:00
|
|
|
|
|
|
|
enum log_level {
|
|
|
|
/* Logging all IO. */
|
2018-02-05 05:09:28 +01:00
|
|
|
LOG_IO_OUT,
|
|
|
|
LOG_IO_IN,
|
2018-02-05 05:09:27 +01:00
|
|
|
/* Gory details which are mainly good for debugging. */
|
|
|
|
LOG_DBG,
|
|
|
|
/* Information about what's going in. */
|
|
|
|
LOG_INFORM,
|
|
|
|
/* That's strange... */
|
|
|
|
LOG_UNUSUAL,
|
|
|
|
/* That's really bad, we're broken. */
|
|
|
|
LOG_BROKEN
|
|
|
|
};
|
2018-02-08 02:25:12 +01:00
|
|
|
#define LOG_LEVEL_MAX LOG_BROKEN
|
2018-02-05 05:09:27 +01:00
|
|
|
|
2020-10-12 07:33:36 +02:00
|
|
|
const char *log_level_name(enum log_level level);
|
|
|
|
bool log_level_parse(const char *levelstr, size_t len,
|
|
|
|
enum log_level *level);
|
|
|
|
|
2018-02-08 02:25:12 +01:00
|
|
|
/*
|
|
|
|
* These errors shouldn't happen:
|
|
|
|
*/
|
2018-02-08 02:25:12 +01:00
|
|
|
enum status_failreason {
|
2018-02-05 05:09:27 +01:00
|
|
|
/* Master daemon sent unknown/malformed command, or fd failed */
|
2018-02-08 02:25:12 +01:00
|
|
|
STATUS_FAIL_MASTER_IO,
|
2018-02-05 05:09:27 +01:00
|
|
|
|
|
|
|
/* Hsmd sent unknown/malformed command, or fd failed */
|
|
|
|
STATUS_FAIL_HSM_IO,
|
|
|
|
|
|
|
|
/* Gossipd sent unknown/malformed command, or fd failed */
|
|
|
|
STATUS_FAIL_GOSSIP_IO,
|
|
|
|
|
|
|
|
/* Other internal error. */
|
|
|
|
STATUS_FAIL_INTERNAL_ERROR,
|
|
|
|
};
|
2018-02-08 02:25:12 +01:00
|
|
|
#define STATUS_FAIL_MAX STATUS_FAIL_INTERNAL_ERROR
|
2018-02-05 05:09:27 +01:00
|
|
|
|
|
|
|
#endif /* LIGHTNING_COMMON_STATUS_LEVELS_H */
|