+ const struct text_item *text_item = to_text_item (item);
+ enum text_item_type type = text_item_get_type (text_item);
+
+ if (type == TEXT_ITEM_SYNTAX)
+ journal_output (j, text_item_get_text (text_item));
+ }
+ else if (is_message_item (item))
+ {
+ const struct message_item *message_item = to_message_item (item);
+ const struct msg *msg = message_item_get_msg (message_item);
+ char *s = msg_to_string (msg, j->command_name);
+ journal_output (j, s);
+ free (s);
+ }
+}
+
+static const struct output_driver_class journal_class =
+ {
+ "journal",
+ journal_destroy,
+ journal_submit,
+ NULL /* flush */
+ };
+\f
+/* Enables journaling. */
+void
+journal_enable (void)
+{
+ if (journal == NULL)
+ {
+ /* If no journal file name is configured, use the default. */