From 0977ab90e5feb02ad53eb660b693adda83c666fc Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 17 Oct 2000 23:37:21 +0000 Subject: Logging fixes. Autologging with same named channels in different networks should work correctly. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@765 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/log.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/core/log.h') diff --git a/src/core/log.h b/src/core/log.h index b8fef2ac..ffb00eb8 100644 --- a/src/core/log.h +++ b/src/core/log.h @@ -1,6 +1,19 @@ #ifndef __LOG_H #define __LOG_H +#include "servers.h" + +enum { + LOG_ITEM_TARGET, /* channel, query, .. */ + LOG_ITEM_WINDOW_REFNUM +}; + +typedef struct { + int type; + char *name; + char *servertag; +} LOG_ITEM_REC; + typedef struct { char *fname; /* file name, in strftime() format */ char *real_fname; /* the current expanded file name */ @@ -8,7 +21,7 @@ typedef struct { time_t opened; int level; /* log only these levels */ - char **items; /* log only on these items (channels, queries, window refnums) */ + GSList *items; /* log only on these items */ time_t last; /* when last message was written */ @@ -21,13 +34,17 @@ extern GSList *logs; /* Create log record - you still need to call log_update() to actually add it into log list */ -LOG_REC *log_create_rec(const char *fname, int level, const char *items); +LOG_REC *log_create_rec(const char *fname, int level); void log_update(LOG_REC *log); void log_close(LOG_REC *log); - LOG_REC *log_find(const char *fname); -void log_write(const char *item, int level, const char *str); +void log_item_add(LOG_REC *log, int type, const char *name, + SERVER_REC *server); +void log_item_destroy(LOG_REC *log, LOG_ITEM_REC *item); +LOG_ITEM_REC *log_item_find(LOG_REC *log, int type, const char *item, + SERVER_REC *server); + void log_write_rec(LOG_REC *log, const char *str); int log_start_logging(LOG_REC *log); -- cgit v1.2.3