changeset 6541:56d6a891c41c HEAD

Log fatal/panic messages coming from child processes as such, instead of converting them to errors.
author Timo Sirainen <tss@iki.fi>
date Tue, 09 Oct 2007 17:11:44 +0300
parents 12a779e08a73
children 402d14b5ef8b
files src/master/log.c
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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, 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 @@
 	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);
+		log_type = LOG_TYPE_ERROR;
 		break;
 	}
+	i_log_type(log_type, "%s%s", prefix, line);
 	t_pop();
 
 	if (!continues)