4 #define LOG_DIR_CREATE_MODE 0700
7 LOG_ITEM_TARGET, /* channel, query, .. */
11 typedef char *(*COLORIZE_FUNC)(const char *str);
20 char *fname; /* file name, in strftime() format */
21 char *real_fname; /* the current expanded file name */
22 int handle; /* file handle */
25 int level; /* log only these levels */
26 GSList *items; /* log only on these items */
28 time_t last; /* when last message was written */
29 COLORIZE_FUNC colorizer;
31 unsigned int autoopen:1; /* automatically start logging at startup */
32 unsigned int failed:1; /* opening log failed last time */
33 unsigned int temp:1; /* don't save this to config file */
38 /* Create log record - you still need to call log_update() to actually add it
40 LOG_REC *log_create_rec(const char *fname, int level);
41 void log_update(LOG_REC *log);
42 void log_close(LOG_REC *log);
43 LOG_REC *log_find(const char *fname);
45 void log_item_add(LOG_REC *log, int type, const char *name,
46 const char *servertag);
47 void log_item_destroy(LOG_REC *log, LOG_ITEM_REC *item);
48 LOG_ITEM_REC *log_item_find(LOG_REC *log, int type, const char *item,
49 const char *servertag);
51 void log_file_write(const char *server_tag, const char *item, int level,
52 const char *str, int no_fallbacks);
53 void log_write_rec(LOG_REC *log, const char *str, int level);
55 int log_start_logging(LOG_REC *log);
56 void log_stop_logging(LOG_REC *log);
59 void log_deinit(void);