"Warning: ",
"Error: ",
"Fatal: ",
- "Panic: ",
- "Error: "
+ "Panic: "
};
/* Initialize working defaults */
va_start(args, format);
- if (type == LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL &&
- error_handler != i_internal_error_handler) {
- /* this is handled specially only by internal logging.
- skip over the pid. */
- T_BEGIN {
- const char *str;
-
- str = t_strdup_vprintf(format, args);
- while (*str >= '0' && *str <= '9') str++;
- if (*str == ' ') str++;
-
- i_error("%s", str);
- } T_END;
- return;
- }
-
if (type == LOG_TYPE_INFO)
info_handler(type, format, args);
else
level = LOG_WARNING;
break;
case LOG_TYPE_ERROR:
- case LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL:
level = LOG_ERR;
break;
case LOG_TYPE_FATAL:
static void
service_process_get_status_error(string_t *str, struct service_process *process,
- int status, enum log_type *type_r)
+ int status, bool *default_fatal_r)
{
struct service *service = process->service;
const char *msg;
- *type_r = LOG_TYPE_ERROR;
+ *default_fatal_r = FALSE;
str_printfa(str, "service(%s): child %s ", service->set->name,
dec2str(process->pid));
str_printfa(str, " (%s)", msg);
if (status == FATAL_DEFAULT)
- *type_r = LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL;
+ *default_fatal_r = TRUE;
}
static void service_process_log(struct service_process *process,
- enum log_type type, const char *str)
+ bool default_fatal, const char *str)
{
const char *data;
- if (type != LOG_TYPE_ERROR_IGNORE_IF_SEEN_FATAL ||
- process->service->log_fd[1] == -1) {
- i_log_type(type, "%s", str);
+ if (!default_fatal || process->service->log_fd[1] == -1) {
+ i_error("%s", str);
return;
}
}
T_BEGIN {
string_t *str = t_str_new(256);
- enum log_type type;
+ bool default_fatal;
- service_process_get_status_error(str, process, status, &type);
+ service_process_get_status_error(str, process, status,
+ &default_fatal);
if (str_len(str) > 0)
- service_process_log(process, type, str_c(str));
+ service_process_log(process, default_fatal, str_c(str));
} T_END;
}