b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame^] | 1 | #ifndef __LIBLOG_H__ |
| 2 | #define __LIBLOG_H__ |
| 3 | |
| 4 | #include <unistd.h> |
| 5 | #include "mbtk_log.h" |
| 6 | |
| 7 | #ifdef __cplusplus |
| 8 | extern "C" { |
| 9 | #endif |
| 10 | |
| 11 | typedef enum |
| 12 | { |
| 13 | LOG_UNSET = -1, |
| 14 | LOG_VERBOSE = 2, |
| 15 | LOG_ERROR = 3, |
| 16 | LOG_WARNING = 4, |
| 17 | LOG_INFO = 6, |
| 18 | LOG_DEBUG = 7, |
| 19 | LOG_LEVEL_MAX = 9 |
| 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 | int lynq_write_log_to_file_now(); |
| 33 | int lynq_stop_record_log(int value); |
| 34 | |
| 35 | |
| 36 | #ifdef __cplusplus |
| 37 | } |
| 38 | #endif |
| 39 | |
| 40 | |
| 41 | #endif //__LOG_H__ |