4
4
* Definitions required for Error Message plugin
6
* Copyright (C) 2008 Sun Microsystems
6
* Copyright (C) 2008 Sun Microsystems, Inc.
8
8
* This program is free software; you can redistribute it and/or modify
9
9
* it under the terms of the GNU General Public License as published by
19
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
#ifndef DRIZZLED_PLUGIN_ERROR_MESSAGE_H
23
#define DRIZZLED_PLUGIN_ERROR_MESSAGE_H
25
#include "drizzled/plugin/plugin.h"
24
#include <drizzled/plugin/plugin.h>
25
#include <drizzled/error/level_t.h>
27
27
#include <stdarg.h>
31
#include <drizzled/visibility.h>
38
class ErrorMessage : public Plugin
39
class DRIZZLED_API ErrorMessage : public Plugin
41
42
ErrorMessage(const ErrorMessage &);
42
43
ErrorMessage& operator=(const ErrorMessage &);
44
46
explicit ErrorMessage(std::string name_arg)
45
47
: Plugin(name_arg, "ErrorMessage")
47
49
virtual ~ErrorMessage() {}
49
virtual bool errmsg(Session *session, int priority,
50
const char *format, va_list ap)=0;
51
virtual bool errmsg(error::level_t priority, const char *format, va_list ap)=0;
52
53
static bool addPlugin(plugin::ErrorMessage *handler);
53
54
static void removePlugin(plugin::ErrorMessage *handler);
55
static bool vprintf(Session *session, int priority, char const *format,
56
static bool vprintf(error::level_t priority, char const *format, va_list ap);
58
bool removeLast() const
59
64
} /* namespace plugin */
60
65
} /* namespace drizzled */
62
#endif /* DRIZZLED_PLUGIN_ERROR_MESSAGE_H */