1 /*
2  * Copyright (C) 2015-2019 Alibaba Group Holding Limited
3  */
4 
5 #ifndef U_LOG_API__H
6 #define U_LOG_API__H
7 #include <stdint.h>
8 #include <stdbool.h>
9 #include "ulog_config.h"
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 extern bool aos_ulog_init;
15 
16 bool log_get_mutex(void);
17 
18 void log_release_mutex(void);
19 
20 void log_init_mutex(void);
21 
22 void on_sync_filter_level_change(const ulog_session_type_t session, const char level);
23 void on_filter_change(const ulog_session_type_t session, const char level);
24 
25 uint8_t ulog_stop_filter_level(const ulog_session_type_t session);
26 
27 char* get_sync_stop_level();
28 
29 int32_t ulog_fs_init(void);
30 
31 void on_filter_level_changes(const ulog_session_type_t session, const uint8_t level);
32 
33 bool check_pass_pop_out(const ulog_session_type_t session, const uint8_t level);
34 
35 void ulog_async_init();
36 
37 int32_t pop_out_on_udp(const char* data, const uint16_t len);
38 
39 int32_t pop_out_on_fs(const char* data, const uint16_t len);
40 
41 void on_show_ulog_file(void);
42 
43 void update_net_cli(const char cmd, const char* param);
44 
45 void fs_control_cli(const char cmd, const char* param);
46 
47 void on_update_syslog_watcher_addr(const uint32_t ip_nl, const uint32_t port);
48 void on_tcpip_service_on(const uint32_t on, const uint32_t off);
49 void on_fs_record_pause(const uint32_t on, const uint32_t off);
50 
51 char* trim_file_path(const char* path);
52 char *ulog_format_time(char *buffer, const int len);
53 
54 int http_start(const char *url, const unsigned short idx);
55 void on_fs_upload(const uint32_t idx, const uint32_t start);
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif /*U_LOG_API__H*/
62 
63