2019-09-18 17:44:47 +02:00
|
|
|
#ifndef LLOG
|
|
|
|
#define LLOG
|
|
|
|
|
2020-04-04 14:35:22 +02:00
|
|
|
/** Liblog Commands Table
|
|
|
|
* State [deprecated, see "Log level"]
|
|
|
|
* Verbosity
|
|
|
|
* Editing
|
|
|
|
* Advanced behaviour
|
|
|
|
**/
|
2020-01-02 22:07:04 +01:00
|
|
|
|
2020-04-04 14:35:22 +02:00
|
|
|
/* ll_clear():
|
|
|
|
Reset log */
|
|
|
|
void ll_clear(void);
|
2020-01-02 22:07:04 +01:00
|
|
|
|
2020-04-04 14:35:22 +02:00
|
|
|
/** Log level:
|
|
|
|
* Customs verbosities for the log stream ->messages have custom levels
|
|
|
|
* Default value is LEVEL_INFO, all messages will be accepted
|
|
|
|
* LEVEL_QUIET disables all types of messages
|
|
|
|
**/
|
|
|
|
typedef enum {LEVEL_INFO=0, LEVEL_WARNING, LEVEL_CRITICAL, LEVEL_FATAL, LEVEL_QUIET} log_level_t;
|
2020-01-02 22:07:04 +01:00
|
|
|
|
|
|
|
/* ll_set_level(log_level_t):
|
2020-04-04 14:35:22 +02:00
|
|
|
sets log verbosity */
|
2020-01-02 22:07:04 +01:00
|
|
|
void ll_set_level(log_level_t);
|
|
|
|
|
|
|
|
/* ll_get_level():
|
2020-04-04 14:35:22 +02:00
|
|
|
return log level */
|
2020-01-06 19:48:41 +01:00
|
|
|
log_level_t ll_get_level(void);
|
2020-01-02 22:07:04 +01:00
|
|
|
|
|
|
|
|
2020-04-04 14:35:22 +02:00
|
|
|
/** Log editing
|
|
|
|
* Use the following functions to send messages
|
|
|
|
**/
|
2020-01-02 22:07:04 +01:00
|
|
|
|
2020-04-04 14:35:22 +02:00
|
|
|
/* ll_send(log_level_t priority, char const * format, ...):
|
|
|
|
Print text
|
|
|
|
This function sends the message with a custom priority
|
|
|
|
Note: A message sent with `LEVEL_QUIET` counts as a `LEVEL_MAX` log */
|
|
|
|
void ll_send(log_level_t p, char const *format, ...);
|
2020-01-02 22:07:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*** Log displaying
|
2020-04-04 14:35:22 +02:00
|
|
|
Here are different functions to display a log
|
|
|
|
There are both in fullscreen */
|
2020-01-02 22:07:04 +01:00
|
|
|
|
|
|
|
/* ll_display():
|
2020-04-04 14:35:22 +02:00
|
|
|
One frame displaying
|
|
|
|
It shows the last lines of the log, without scrolling ability */
|
2020-01-02 22:07:04 +01:00
|
|
|
void ll_display(void);
|
|
|
|
|
|
|
|
/* ll_pause():
|
2020-04-04 14:35:22 +02:00
|
|
|
Display log, enable scrolling with arrows, and waits the user to press Exit */
|
2020-01-02 22:07:04 +01:00
|
|
|
void ll_pause(void);
|
|
|
|
|
|
|
|
|
2020-04-04 14:35:22 +02:00
|
|
|
/** Advanced behaviour
|
|
|
|
* This funciont sets the behaviour when an exception occurs
|
|
|
|
**/
|
2020-01-02 22:07:04 +01:00
|
|
|
void ll_set_panic(void);
|
2019-10-01 19:30:42 +02:00
|
|
|
|
2019-09-18 17:44:47 +02:00
|
|
|
#endif
|