~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/errmsg_print.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-07-08 04:26:02 UTC
  • mto: (1089.3.4 merge)
  • mto: This revision was merged to the branch mainline in revision 1092.
  • Revision ID: osullivan.padraig@gmail.com-20090708042602-x4hmf9ny8dcpvb22
Replaced an instance where a uint8_t type was being used to hold a
collection of flags. Converted it to a std::bitset<2> instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
   errmsg_printf()
23
23
*/
24
24
 
25
 
#include "config.h"
26
 
#include <drizzled/plugin/registry.h>
 
25
#include <drizzled/server_includes.h>
 
26
#include <drizzled/errmsg.h>
27
27
#include <drizzled/errmsg_print.h>
28
28
#include <drizzled/current_session.h>
29
 
#include <drizzled/plugin/error_message.h>
30
 
 
31
 
#include <cerrno>
32
 
#include <cstring>
33
 
 
34
 
namespace drizzled
35
 
{
 
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
}
36
59
 
37
60
void sql_perror(const char *message)
38
61
{
40
63
  errmsg_printf(ERRMSG_LVL_ERROR, "%s: %s", message, strerror(errno));
41
64
}
42
65
 
 
66
 
43
67
bool errmsg_printf (int priority, char const *format, ...)
44
68
{
45
69
  bool rv;
46
70
  va_list args;
47
71
  va_start(args, format);
48
 
  rv= plugin::ErrorMessage::vprintf(current_session, priority, format, args);
 
72
  rv= errmsg_vprintf(current_session, priority, format, args);
49
73
  va_end(args);
50
74
  return rv;
51
75
}
52
 
 
53
 
} /* namespace drizzled */