| 17 |
#ifndef _LOG_H_ |
#ifndef _LOG_H_ |
| 18 |
#define _LOG_H_ |
#define _LOG_H_ |
| 19 |
|
|
| 20 |
#include <stddef.h> |
#include <stdio.h> |
| 21 |
|
|
| 22 |
extern int log_begin(char *common_log_file, char *error_log_file); |
enum{ |
| 23 |
|
LOG_LEVEL_COMMON = 1, |
| 24 |
|
LOG_LEVEL_ERROR = 2, |
| 25 |
|
}; |
| 26 |
|
|
| 27 |
|
extern int log_begin(char *common_log_file, char *error_log_file); |
| 28 |
extern void log_end(); |
extern void log_end(); |
| 29 |
|
|
| 30 |
extern int log_head(char *buf, size_t len); |
extern int log_printf(int log_level, const char *app_file, int app_line, const char *format, ...); |
| 31 |
|
|
| 32 |
extern int log_common(const char *format, ...); |
#define log_common(...) log_printf(LOG_LEVEL_COMMON, __FILE__, __LINE__, __VA_ARGS__) |
| 33 |
|
#define log_error(...) log_printf(LOG_LEVEL_ERROR, __FILE__, __LINE__, __VA_ARGS__) |
|
extern int log_error(const char *format, ...); |
|
| 34 |
|
|
| 35 |
extern int log_common_redir(int fd); |
extern int log_common_redir(int fd); |
|
|
|
| 36 |
extern int log_error_redir(int fd); |
extern int log_error_redir(int fd); |
| 37 |
|
|
| 38 |
#endif //_LOG_H_ |
#endif //_LOG_H_ |