From 0473d2c8db2875bfd7049a94f662984a8e8f815b Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 12 Feb 2005 21:21:54 +0000 Subject: Plugins messages are logged with new config option (log_plugin_msg); on server buffer, only server messages are logged --- src/common/log.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/common/log.c') diff --git a/src/common/log.c b/src/common/log.c index cdaaba286..06f62f7cd 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -31,6 +31,7 @@ #include "weechat.h" #include "log.h" #include "weeconfig.h" +#include "../gui/gui.h" /* @@ -71,6 +72,28 @@ log_write (t_gui_buffer *buffer, char *message) } } +/* + * log_write_line: writes a WeeChat line to log file + */ + +void +log_write_line (t_gui_buffer *buffer, t_gui_line *line) +{ + t_gui_message *ptr_msg; + + if (buffer->log_file) + { + log_write_date (buffer); + for (ptr_msg = line->messages; ptr_msg; ptr_msg = ptr_msg->next_message) + { + if (ptr_msg->type != MSG_TYPE_TIME) + fprintf (buffer->log_file, "%s", ptr_msg->message); + } + fprintf (buffer->log_file, "\n"); + fflush (buffer->log_file); + } +} + /* * log_start: starts a log */ -- cgit v1.2.3