1 #ifndef LIGHTNING_COMMON_STATUS_LEVELS_H
2 #define LIGHTNING_COMMON_STATUS_LEVELS_H
3 #include "config.h"
4 #include <ccan/tal/tal.h>
5 
6 enum log_level {
7 	/* Logging all IO. */
8 	LOG_IO_OUT,
9 	LOG_IO_IN,
10 	/* Gory details which are mainly good for debugging. */
11 	LOG_DBG,
12 	/* Information about what's going in. */
13 	LOG_INFORM,
14 	/* That's strange... */
15 	LOG_UNUSUAL,
16 	/* That's really bad, we're broken. */
17 	LOG_BROKEN
18 };
19 #define LOG_LEVEL_MAX LOG_BROKEN
20 
21 const char *log_level_name(enum log_level level);
22 bool log_level_parse(const char *levelstr, size_t len,
23 		     enum log_level *level);
24 
25 /*
26  * These errors shouldn't happen:
27  */
28 enum status_failreason {
29 	/* Master daemon sent unknown/malformed command, or fd failed */
30 	STATUS_FAIL_MASTER_IO,
31 
32 	/* Hsmd sent unknown/malformed command, or fd failed */
33 	STATUS_FAIL_HSM_IO,
34 
35 	/* Gossipd sent unknown/malformed command, or fd failed */
36 	STATUS_FAIL_GOSSIP_IO,
37 
38 	/* Other internal error. */
39 	STATUS_FAIL_INTERNAL_ERROR,
40 };
41 #define STATUS_FAIL_MAX STATUS_FAIL_INTERNAL_ERROR
42 
43 #endif /* LIGHTNING_COMMON_STATUS_LEVELS_H */
44