67 lines
1.3 KiB
C
Executable File
67 lines
1.3 KiB
C
Executable File
#ifndef _LOG_TYPES_H
|
|
#define _LOG_TYPES_H
|
|
|
|
#include "ulog_api.h"
|
|
|
|
#define LOG_HOST_SZ 256
|
|
|
|
|
|
#define MAX_LINE_SZ 1024
|
|
#define MAX_PATH_SZ MAX_LINE_SZ
|
|
#define MAX_U64_SZ 21
|
|
|
|
|
|
|
|
typedef enum {
|
|
LOG_OFF = 0,
|
|
LOG_ON
|
|
} log_sw_t;
|
|
|
|
typedef struct _log_console {
|
|
u8 level;
|
|
log_sw_t on;
|
|
char module[MAX_MODULE_NAME_SZ];
|
|
} log_console_t;
|
|
|
|
typedef log_console_t log_pty_t;
|
|
|
|
typedef enum {
|
|
LOG_RFC_UNKNOWN = -1,
|
|
LOG_RFC_3164 = 0,
|
|
LOG_RFC_5424
|
|
} log_rfc_t;
|
|
|
|
typedef struct _log_remote_host {
|
|
log_rfc_t rfc;
|
|
char host[LOG_HOST_SZ];
|
|
u16 port;
|
|
} log_remote_host_t;
|
|
|
|
typedef struct _log_remote_level {
|
|
u8 level;
|
|
} log_remote_level_t;
|
|
|
|
typedef struct _log_remote_host_x {
|
|
log_rfc_t rfc;
|
|
char host[LOG_HOST_SZ];
|
|
u16 port;
|
|
u8 level;
|
|
} log_remote_host_x_t;
|
|
|
|
|
|
typedef enum {
|
|
LOG_UNCOMPRESS = 0,
|
|
LOG_COMPRESS
|
|
} log_compress_t;
|
|
|
|
typedef struct _log_file {
|
|
u8 level;
|
|
char path[MAX_PATH_SZ];
|
|
log_compress_t is_compress;
|
|
u32 del_over_days;
|
|
char del_over_size[MAX_U64_SZ];
|
|
} log_file_t;
|
|
|
|
|
|
#endif
|