2019-07-26 03:53:33 +00:00
|
|
|
#ifndef _LOG_COMMON_H
|
|
|
|
#define _LOG_COMMON_H
|
|
|
|
|
2019-08-15 09:17:12 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2019-07-26 03:53:33 +00:00
|
|
|
#include "ulog_api.h"
|
2019-08-14 09:17:18 +00:00
|
|
|
#include "log_types.h"
|
2019-08-15 10:18:51 +00:00
|
|
|
#include "rpc_conn.h"
|
2019-07-26 03:53:33 +00:00
|
|
|
|
|
|
|
#define LOG_CONF_PATH "/etc/rsyslog.d/"
|
|
|
|
|
2019-07-29 10:20:17 +00:00
|
|
|
#define LOG_DEV_DIR "/dev/"
|
2019-07-30 10:22:02 +00:00
|
|
|
#define BAK_FILE "/tmp/%s"
|
|
|
|
|
|
|
|
|
|
|
|
#define REDIRECT_SEPERATE " "
|
2019-07-29 10:20:17 +00:00
|
|
|
|
2019-08-16 07:49:28 +00:00
|
|
|
typedef int (*rpc_cb)(pointer *input, const void *arg, char *str_err, int str_len);
|
2019-08-15 10:18:51 +00:00
|
|
|
|
2019-07-26 03:53:33 +00:00
|
|
|
extern ulog_t *g_log;
|
2019-08-01 08:44:18 +00:00
|
|
|
extern FILE *g_conf_fp;
|
|
|
|
extern char g_conf_file[MAX_PATH_SZ];
|
2019-07-26 03:53:33 +00:00
|
|
|
|
2019-07-29 10:20:17 +00:00
|
|
|
int log_conf(const u8 level, const char *conf_path, const char *conf_file, const char *filter_mod,
|
|
|
|
int (*cb_content)(FILE *fp, const u8 level, const char *filter_mod, void *arg), void *arg);
|
|
|
|
int log_conf_append(const u8 level, const char *conf_path, const char *conf_file, const char *filter_mod,
|
2019-07-29 03:50:57 +00:00
|
|
|
int (*cb_content)(FILE *fp, const u8 level, const char *filter_mod, void *arg), void *arg);
|
|
|
|
int write_conf_content(FILE *fp, const u8 level, const char *filter_mod, void *arg);
|
|
|
|
int write_conf_content_authorizing(FILE *fp, const u8 level, const char *filter_mod, void *arg);
|
2019-08-02 09:58:02 +00:00
|
|
|
int log_level_to_str(const u8 level, char *str, u32 len);
|
2019-08-14 09:17:18 +00:00
|
|
|
int log_off_with_file(const char *path, const char *file_name);
|
2019-08-16 07:49:28 +00:00
|
|
|
void rpc_conf_proc(rpc_conn *conn, pointer input, int input_len, int need_len, rpc_cb cb, void *arg);
|
2019-07-26 03:53:33 +00:00
|
|
|
|
|
|
|
#endif
|