b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 1 | #ifndef __LIBLOG_H__ |
| 2 | #define __LIBLOG_H__ |
| 3 | |
| 4 | #include <unistd.h> |
xf.li | 44e0869 | 2024-01-30 01:54:44 -0800 | [diff] [blame] | 5 | #include "mbtk_log.h" |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 6 | |
| 7 | #ifdef __cplusplus |
| 8 | extern "C" { |
| 9 | #endif |
| 10 | |
| 11 | typedef enum |
| 12 | { |
| 13 | LOG_UNSET = -1, |
b.liu | f37bd33 | 2024-03-18 13:51:24 +0800 | [diff] [blame] | 14 | LOG_VERBOSE = 8, |
| 15 | LOG_ERROR = 3, |
| 16 | LOG_WARNING = 4, |
| 17 | LOG_INFO = 6, |
| 18 | LOG_DEBUG = 7, |
| 19 | LOG_LEVEL_MAX = 9 |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 20 | }log_level_enum; |
| 21 | |
| 22 | void lynq_log_global_output(log_level_enum Level,const char *format,...); |
| 23 | void lynq_log_configuration_init(const char *log_name); |
| 24 | const char* lynq_read_log_version(); |
| 25 | |
| 26 | //log level api |
| 27 | int lynq_set_log_level(const char * module_name, log_level_enum level); |
| 28 | int lynq_get_log_level(const char * module_name, log_level_enum *level); |
| 29 | int lynq_set_special_log_level(const char * exe_name, const char * module_name, log_level_enum level); |
| 30 | int lynq_get_special_log_level(const char * exe_name, const char * module_name, log_level_enum *level); |
| 31 | int lynq_notify_recalc_log_level(pid_t pid); |
| 32 | |
| 33 | #ifdef __cplusplus |
| 34 | } |
| 35 | #endif |
| 36 | |
xf.li | 44e0869 | 2024-01-30 01:54:44 -0800 | [diff] [blame] | 37 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 38 | #endif //__LOG_H__ |