Une lib de log simple d'utilisation nécéssitant gint.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

61 lines
1.4 KiB

#ifndef LLOG
#define LLOG
/** Liblog Commands Table
* State [deprecated, see "Log level"]
* Verbosity
* Editing
* Advanced behaviour
**/
/* ll_clear():
Reset log */
void ll_clear(void);
/** 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;
/* ll_set_level(log_level_t):
sets log verbosity */
void ll_set_level(log_level_t);
/* ll_get_level():
return log level */
log_level_t ll_get_level(void);
/** Log editing
* Use the following functions to send messages
**/
/* 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, ...);
/*** Log displaying
Here are different functions to display a log
There are both in fullscreen */
/* ll_display():
One frame displaying
It shows the last lines of the log, without scrolling ability */
void ll_display(void);
/* ll_pause():
Display log, enable scrolling with arrows, and waits the user to press Exit */
void ll_pause(void);
/** Advanced behaviour
* This funciont sets the behaviour when an exception occurs
**/
void ll_set_panic(void);
#endif