~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/syslog/logging.cc

  • Committer: Lee Bieber
  • Date: 2010-11-16 17:50:17 UTC
  • mfrom: (1932.3.2 trunk)
  • Revision ID: kalebral@gmail.com-20101116175017-sken3dkkpfcd2snv
Merge Brian - session fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
  if ((t_mark - session->start_utime) < syslog_module::sysvar_logging_threshold_slow)
102
102
    return false;
103
103
  
104
 
  /* to avoid trying to printf %s something that is potentially NULL */
105
 
  
106
 
  const char *dbs= session->db.empty() ? "" : session->db.c_str();
107
 
  
108
 
  const char *qys= (! session->getQueryString().empty()) ? session->getQueryString().c_str() : "";
109
 
  int qyl= 0;
110
 
  if (qys)
111
 
    qyl= session->getQueryLength();
 
104
  Session::QueryString query_string(session->getQueryString());
112
105
 
113
106
  WrapSyslog::singleton()
114
107
    .log(syslog_facility, syslog_priority,
121
114
         " tmp_table=%ld total_warn_count=%ld\n",
122
115
         (unsigned long) session->thread_id,
123
116
         (unsigned long) session->getQueryId(),
124
 
         (int) session->db.length(), dbs,
125
 
         qyl, qys,
 
117
         (int) session->getSchema().length(),
 
118
         session->getSchema().empty() ? "" : session->getSchema().c_str(),
 
119
         (int) query_string->length(), 
 
120
         query_string->empty() ? "" : query_string->c_str(),
126
121
         (int) command_name[session->command].length,
127
122
         command_name[session->command].str,
128
123
         (unsigned long long) (t_mark - session->getConnectMicroseconds()),