- if (msg_file != stdout || get_error_routing_to_terminal ())
- dump_message (ds_cstr (&string), get_viewwidth (), 8, msg_file);
+ routing = settings_get_output_routing (severity->type);
+ if (msg_file != stdout || routing & SETTINGS_DEVICE_TERMINAL)
+ dump_message (ds_cstr (&string),
+ isatty (fileno (msg_file)) ? settings_get_viewwidth () : INT_MAX, 8,
+ write_stream, msg_file);
+
+ dump_message (ds_cstr (&string), 78, 0, write_journal, NULL);
+
+ if (routing & SETTINGS_DEVICE_LISTING)
+ {
+ /* Disable terminal output devices, because the error should already have
+ been reported to the terminal with the dump_message call above. */
+ settings_set_output_routing (severity->type,
+ routing & ~SETTINGS_DEVICE_TERMINAL);
+ tab_output_text (TAB_LEFT, ds_cstr (&string));
+ settings_set_output_routing (severity->type, routing);
+ }