diff options
author | Timo Sirainen <cras@irssi.org> | 2000-04-26 08:03:38 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-04-26 08:03:38 +0000 |
commit | c95034c6de1bf72536595e1e3431d8ec64b9880e (patch) | |
tree | e51aa4528257ed8aa9d53640649519f299aaf0c7 /src/core/log.h | |
parent | d01b094151705d433bc43cae9eeb304e6f110a17 (diff) | |
download | irssi-c95034c6de1bf72536595e1e3431d8ec64b9880e.zip |
..adding new files..
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@171 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/log.h')
-rw-r--r-- | src/core/log.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/core/log.h b/src/core/log.h new file mode 100644 index 00000000..599be9e2 --- /dev/null +++ b/src/core/log.h @@ -0,0 +1,49 @@ +#ifndef __LOG_H +#define __LOG_H + +enum { + LOG_ROTATE_NEVER, + LOG_ROTATE_HOUR, + LOG_ROTATE_DAY, + LOG_ROTATE_WEEK, + LOG_ROTATE_MONTH +}; + +typedef struct { + char *fname; /* file name */ + int handle; /* file handle */ + time_t opened; + + int level; /* log only these levels */ + char **items; /* log only on these items (channels, queries, window refnums) */ + + time_t last; /* when last message was written */ + int rotate; + + int autoopen:1; /* automatically start logging at startup */ + int temp:1; /* don't save this to config file */ +} LOG_REC; + +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); +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_write_rec(LOG_REC *log, const char *str); + +const char *log_rotate2str(int rotate); +int log_str2rotate(const char *str); + +int log_start_logging(LOG_REC *log); +void log_stop_logging(LOG_REC *log); + +void log_init(void); +void log_deinit(void); + +#endif |