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 | |
b.liu | ecf6534 | 2025-05-24 12:59:30 +0800 | [diff] [blame] | 22 | typedef enum |
| 23 | { |
| 24 | SYSLOG_OPEN = 0, |
| 25 | SYSLOG_CLOSE = 1, |
| 26 | KERNEL_LOG_OPEN = 2, |
| 27 | KERNEL_LOG_CLOSE = 3 |
| 28 | }CONTROL_TYPE; |
| 29 | |
| 30 | |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 31 | void lynq_log_global_output(log_level_enum Level,const char *format,...); |
| 32 | void lynq_log_configuration_init(const char *log_name); |
| 33 | const char* lynq_read_log_version(); |
| 34 | |
| 35 | //log level api |
| 36 | int lynq_set_log_level(const char * module_name, log_level_enum level); |
| 37 | int lynq_get_log_level(const char * module_name, log_level_enum *level); |
| 38 | int lynq_set_special_log_level(const char * exe_name, const char * module_name, log_level_enum level); |
| 39 | int lynq_get_special_log_level(const char * exe_name, const char * module_name, log_level_enum *level); |
| 40 | int lynq_notify_recalc_log_level(pid_t pid); |
| 41 | int lynq_write_log_to_file_now(); |
| 42 | int lynq_stop_record_log(int value); |
b.liu | ecf6534 | 2025-05-24 12:59:30 +0800 | [diff] [blame] | 43 | int lynq_syslog_control(CONTROL_TYPE value); |
| 44 | int lynq_kernel_log_control(CONTROL_TYPE value); |
b.liu | d440f9f | 2025-04-18 10:44:31 +0800 | [diff] [blame] | 45 | |
| 46 | |
| 47 | #ifdef __cplusplus |
| 48 | } |
| 49 | #endif |
| 50 | |
| 51 | |
| 52 | #endif //__LOG_H__ |