int len, pass;
int linecount = 0;
-if (running_in_test_harness) return;
-
if (!syslog_pid && LOGGING(pid))
s = string_sprintf("%.*s%s", (int)pid_position[0], s, s + pid_position[1]);
if (!syslog_timestamp)
len = Ustrlen(s);
#ifndef NO_OPENLOG
-if (!syslog_open)
+if (!syslog_open && !f.running_in_test_harness)
{
# ifdef SYSLOG_LOG_PID
openlog(CS syslog_processname, LOG_PID|LOG_CONS, syslog_facility);
tlen -= plen;
if (ss[plen] == '\n') tlen--; /* chars left */
- if (pass == 0) linecount++; else
- {
+ if (pass == 0)
+ linecount++;
+ else if (f.running_in_test_harness)
+ if (linecount == 1)
+ fprintf(stderr, "SYSLOG: '%.*s'\n", plen, ss);
+ else
+ fprintf(stderr, "SYSLOG: '[%d%c%d] %.*s'\n", i,
+ ss[plen] == '\n' && tlen != 0 ? '\\' : '/',
+ linecount, plen, ss);
+ else
if (linecount == 1)
syslog(priority, "%.*s", plen, ss);
else
syslog(priority, "[%d%c%d] %.*s", i,
ss[plen] == '\n' && tlen != 0 ? '\\' : '/',
linecount, plen, ss);
- }
+
ss += plen;
if (*ss == '\n') ss++;
}
if (log_stderr && log_stderr != debug_file)
fprintf(log_stderr, "%s\n", s1);
}
-if (receive_call_bombout) receive_bomb_out(NULL, s2); /* does not return */
+if (f.receive_call_bombout) receive_bomb_out(NULL, s2); /* does not return */
if (smtp_input) smtp_closedown(s2);
exim_exit(EXIT_FAILURE, NULL);
}
Ustrcpy(ptr, "Exim configuration error");
ptr += 24;
-if ((flags & (LOG_CONFIG_FOR & ~LOG_CONFIG)) != 0)
+if (flags & (LOG_CONFIG_FOR & ~LOG_CONFIG))
{
Ustrcpy(ptr, " for ");
return ptr + 5;
}
-if ((flags & (LOG_CONFIG_IN & ~LOG_CONFIG)) != 0)
+if (flags & (LOG_CONFIG_IN & ~LOG_CONFIG))
ptr += sprintf(CS ptr, " in line %d of %s", config_lineno, config_filename);
Ustrcpy(ptr, ":\n ");
/* There are some weird circumstances in which logging is disabled. */
-if (disable_logging)
+if (f.disable_logging)
{
DEBUG(D_any) debug_printf("log writing disabled\n");
return;
if (!syslog_pid) pid_position[1] = ptr - log_buffer; /* … and end+1 of the PID */
}
-if (really_exim && message_id[0] != 0)
+if (f.really_exim && message_id[0] != 0)
ptr += sprintf(CS ptr, "%s ", message_id);
if (flags & LOG_CONFIG) ptr = log_config_info(ptr, flags);
Write to log_stderr unless debugging (when it will already have been written),
or unless there is no log_stderr (expn called from daemon, for example). */
-if (!really_exim || log_testing_mode)
+if (!f.really_exim || f.log_testing_mode)
{
if ( !debug_selector
&& log_stderr