~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/errmsg_print.cc

  • Committer: Brian Aker
  • Date: 2010-04-05 23:46:43 UTC
  • Revision ID: brian@gaz-20100405234643-0he3xnj902rc70r8
Fixing tests to work with PBXT.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Mark Atwood
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
22
22
   errmsg_printf()
23
23
*/
24
24
 
25
 
#include <drizzled/server_includes.h>
26
 
#include <drizzled/errmsg.h>
 
25
#include "config.h"
 
26
#include <drizzled/plugin/registry.h>
27
27
#include <drizzled/errmsg_print.h>
28
28
#include <drizzled/current_session.h>
29
 
 
30
 
// need this for stderr
31
 
#include <string.h>
32
 
 
33
 
void sql_print_error(const char *format, ...)
34
 
{
35
 
  va_list args;
36
 
  va_start(args, format);
37
 
  errmsg_vprintf(current_session, ERROR_LEVEL, format, args);
38
 
  va_end(args);
39
 
  return;
40
 
}
41
 
 
42
 
void sql_print_warning(const char *format, ...)
43
 
{
44
 
  va_list args;
45
 
  va_start(args, format);
46
 
  errmsg_vprintf(current_session, WARNING_LEVEL, format, args);
47
 
  va_end(args);
48
 
  return;
49
 
}
50
 
 
51
 
void sql_print_information(const char *format, ...)
52
 
{
53
 
  va_list args;
54
 
  va_start(args, format);
55
 
  errmsg_vprintf(current_session, INFORMATION_LEVEL, format, args);
56
 
  va_end(args);
57
 
  return;
58
 
}
 
29
#include <drizzled/plugin/error_message.h>
 
30
 
 
31
#include <cerrno>
 
32
#include <cstring>
 
33
 
 
34
namespace drizzled
 
35
{
59
36
 
60
37
void sql_perror(const char *message)
61
38
{
63
40
  errmsg_printf(ERRMSG_LVL_ERROR, "%s: %s", message, strerror(errno));
64
41
}
65
42
 
66
 
 
67
43
bool errmsg_printf (int priority, char const *format, ...)
68
44
{
69
45
  bool rv;
70
46
  va_list args;
71
47
  va_start(args, format);
72
 
  rv= errmsg_vprintf(current_session, priority, format, args);
 
48
  rv= plugin::ErrorMessage::vprintf(current_session, priority, format, args);
73
49
  va_end(args);
74
50
  return rv;
75
51
}
 
52
 
 
53
} /* namespace drizzled */