dovecot: Log fatal/panic messages coming from child processes as...

dovecot at dovecot.org dovecot at dovecot.org
Tue Oct 9 17:23:18 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/56d6a891c41c
changeset: 6541:56d6a891c41c
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Oct 09 17:11:44 2007 +0300
description:
Log fatal/panic messages coming from child processes as such, instead of
converting them to errors.

diffstat:

1 file changed, 16 insertions(+), 5 deletions(-)
src/master/log.c |   21 ++++++++++++++++-----

diffs (42 lines):

diff -r 12a779e08a73 -r 56d6a891c41c src/master/log.c
--- a/src/master/log.c	Tue Oct 09 17:10:50 2007 +0300
+++ b/src/master/log.c	Tue Oct 09 17:11:44 2007 +0300
@@ -90,6 +90,7 @@ static int log_it(struct log_io *log_io,
 static int log_it(struct log_io *log_io, const char *line, bool continues)
 {
 	const char *prefix;
+	enum log_type log_type;
 
 	if (log_io->next_log_type == '\0') {
 		if (line[0] == 1 && line[1] != '\0') {
@@ -106,15 +107,25 @@ static int log_it(struct log_io *log_io,
 	prefix = log_io->prefix != NULL ? log_io->prefix : "";
 	switch (log_io->next_log_type) {
 	case 'I':
-		i_info("%s%s", prefix, line);
+		log_type = LOG_TYPE_INFO;
 		break;
 	case 'W':
-		i_warning("%s%s", prefix, line);
+		log_type = LOG_TYPE_WARNING;
+		break;
+	case 'E':
+		log_type = LOG_TYPE_ERROR;
+		break;
+	case 'F':
+		log_type = LOG_TYPE_FATAL;
+		break;
+	case 'P':
+		log_type = LOG_TYPE_PANIC;
 		break;
 	default:
-		i_error("%s%s", prefix, line);
-		break;
-	}
+		log_type = LOG_TYPE_ERROR;
+		break;
+	}
+	i_log_type(log_type, "%s%s", prefix, line);
 	t_pop();
 
 	if (!continues)


More information about the dovecot-cvs mailing list