{
struct output_driver driver;
FILE *file;
- char *command_name;
/* Name of journal file. */
char *file_name;
{
struct journal_driver *j = journal_driver_cast (driver);
- if ( !j->destroyed)
- {
- journal_close ();
- free (j->command_name);
- }
+ if (!j->destroyed)
+ journal_close ();
j->destroyed = true;
}
static void
journal_output (struct journal_driver *j, const char *s)
{
- if ( j->file == NULL)
+ if (j->file == NULL)
return;
fprintf (j->file, "%s\n", s);
{
struct journal_driver *j = journal_driver_cast (driver);
- output_driver_track_current_command (item, &j->command_name);
-
if (is_text_item (item))
{
const struct text_item *text_item = to_text_item (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);
+ char *s = msg_to_string (message_item_get_msg (message_item));
journal_output (j, s);
free (s);
}
output_driver_init (&journal.driver, &journal_class, "journal",
SETTINGS_DEVICE_UNFILTERED);
journal.file = NULL;
- journal.command_name = NULL;
/* Register journal driver. */
output_driver_register (&journal.driver);