76:5f7660fe1562 | 77:f1cff81e425a |
---|---|
44 int log_stdout; | 44 int log_stdout; |
45 int log_stderr; | 45 int log_stderr; |
46 } LogConfig; | 46 } LogConfig; |
47 | 47 |
48 typedef struct { | 48 typedef struct { |
49 FILE *file; | |
50 uint32_t ref; | |
51 } LogFile; | |
52 | |
53 typedef struct { | |
49 sstr_t file; | 54 sstr_t file; |
50 sstr_t format; // unused | 55 sstr_t format; // unused |
51 FILE *log; | 56 LogFile *log; |
52 uint32_t ref; | |
53 } AccessLog; | 57 } AccessLog; |
54 | 58 |
55 // server logging | 59 // server logging |
56 int init_log_file(LogConfig *cfg); | 60 int init_log_file(LogConfig *cfg); |
57 | 61 |
62 sstr_t log_get_prefix(int level); | 66 sstr_t log_get_prefix(int level); |
63 | 67 |
64 int log_ereport(int degree, const char *format, ...); | 68 int log_ereport(int degree, const char *format, ...); |
65 | 69 |
66 // access logging | 70 // access logging |
67 AccessLog* get_access_log(sstr_t file, sstr_t format); | 71 LogFile* get_access_log_file(sstr_t file); |
68 AccessLog* get_default_access_log(); | |
69 | |
70 // TODO: ref/unref | |
71 | 72 |
72 #ifdef __cplusplus | 73 #ifdef __cplusplus |
73 } | 74 } |
74 #endif | 75 #endif |
75 | 76 |