static int log_connection_event()

in plugin/server_audit/server_audit.cc [1291:1309]


static int log_connection_event(const struct mysql_event_connection *event,
                                const char *type)
{
  time_t ctime;
  size_t csize;
  char message[1024];

  (void) time(&ctime);
  csize= log_header(message, sizeof(message)-1, &ctime,
                    servhost, servhost_len,
                    event->user.str, event->user.length,
                    event->host.str, event->host.length,
                    event->ip.str, event->ip.length,
                    event->connection_id, 0, type);
  csize+= snprintf(message+csize, sizeof(message) - 1 - csize,
    ",%.*s,,%d,%s", static_cast<int>(event->database.length), event->database.str, event->status, connection_type_map[event->connection_type]);
  message[csize]= '\n';
  return write_log(message, csize + 1, 1);
}