~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_query/logging_query.cc

  • Committer: Brian Aker
  • Date: 2011-01-12 06:45:23 UTC
  • mto: (2073.1.4 catalogs)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: brian@tangent.org-20110112064523-rqhptaqbph22qmj1
RemoveĀ customĀ error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <config.h>
 
20
#include "config.h"
21
21
#include <drizzled/plugin/logging.h>
22
22
#include <drizzled/gettext.h>
23
23
#include <drizzled/session.h>
171
171
    fd= open(_filename.c_str(),
172
172
             O_WRONLY | O_APPEND | O_CREAT,
173
173
             S_IRUSR|S_IWUSR);
174
 
 
175
174
    if (fd < 0)
176
175
    {
177
 
      sql_perror( _("fail open()"), _filename);
 
176
      char errmsg[STRERROR_MAX];
 
177
      strerror_r(errno, errmsg, sizeof(errmsg));
 
178
      errmsg_printf(ERRMSG_LVL_ERROR, _("fail open() fn=%s er=%s\n"),
 
179
                    _filename.c_str(),
 
180
                    errmsg);
178
181
      return;
179
182
    }
180
183
 
268
271
              % session->getQueryId()
269
272
              % dbs
270
273
              % qs
271
 
              % getCommandName(session->command)
 
274
              % command_name[session->command].str
272
275
              % (t_mark - session->getConnectMicroseconds())
273
276
              % session->getElapsedTime()
274
277
              % (t_mark - session->utime_after_lock)
277
280
              % session->tmp_table
278
281
              % session->total_warn_count
279
282
              % session->getServerId()
280
 
              % getServerHostname();
 
283
              % glob_hostname;
281
284
 
282
285
    string msgbuf= formatter.str();
283
286