31 lines
1.1 KiB
C
Executable File
31 lines
1.1 KiB
C
Executable File
#ifndef _LOG_COMMON_H
|
|
#define _LOG_COMMON_H
|
|
|
|
#include "ulog_api.h"
|
|
|
|
#define MAX_LINE_SZ 1024
|
|
#define MAX_PATH_SZ MAX_LINE_SZ
|
|
|
|
#define LOG_CONF_PATH "/etc/rsyslog.d/"
|
|
|
|
#define LOG_DEV_DIR "/dev/"
|
|
#define BAK_FILE "/tmp/%s"
|
|
|
|
|
|
#define REDIRECT_SEPERATE " "
|
|
|
|
extern ulog_t *g_log;
|
|
extern FILE *g_conf_fp;
|
|
extern char g_conf_file[MAX_PATH_SZ];
|
|
|
|
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,
|
|
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);
|
|
int log_level_to_str(const u8 level, char *str, u32 len);
|
|
|
|
|
|
#endif
|