1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Mark Atwood
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
/* This file and these functions are a stopgap until all the
21
sql_print_foo() function calls are replaced with calls to
25
#include <drizzled/server_includes.h>
26
#include <drizzled/errmsg.h>
27
#include <drizzled/errmsg_print.h>
28
#include <drizzled/current_session.h>
30
// need this for stderr
33
void sql_print_error(const char *format, ...)
36
va_start(args, format);
37
errmsg_vprintf(current_session, ERROR_LEVEL, format, args);
42
void sql_print_warning(const char *format, ...)
45
va_start(args, format);
46
errmsg_vprintf(current_session, WARNING_LEVEL, format, args);
51
void sql_print_information(const char *format, ...)
54
va_start(args, format);
55
errmsg_vprintf(current_session, INFORMATION_LEVEL, format, args);
60
void sql_perror(const char *message)
62
// is stderr threadsafe?
63
sql_print_error("%s: %s", message, strerror(errno));