Example #1
0
static gchar *
_concat_nvpairs(LogTransportAuxData *aux)
{
  GString *concatenated = g_string_sized_new(0);

  log_transport_aux_data_foreach(aux, _concat_nvpairs_helper, concatenated);
  return g_string_free(concatenated, FALSE);
}
Example #2
0
static gboolean
log_reader_handle_line(LogReader *self, const guchar *line, gint length, LogTransportAuxData *aux)
{
  LogMessage *m;

  msg_debug("Incoming log entry",
            evt_tag_printf("line", "%.*s", length, line));
  /* use the current time to get the time zone offset */
  m = log_msg_new((gchar *) line, length,
                  aux->peer_addr ? : self->peer_addr,
                  &self->options->parse_options);

  log_msg_refcache_start_producer(m);

  log_transport_aux_data_foreach(aux, _add_aux_nvpair, m);

  log_source_post(&self->super, m);
  log_msg_refcache_stop();
  return log_source_free_to_send(&self->super);
}