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
22
22
#ifndef DRIZZLED_PLUGIN_ERROR_MESSAGE_H
23
23
#define DRIZZLED_PLUGIN_ERROR_MESSAGE_H
25
#include "drizzled/plugin/plugin.h"
25
#include <drizzled/plugin/plugin.h>
26
#include <drizzled/error/level_t.h>
27
28
#include <stdarg.h>
32
#include <drizzled/visibility.h>
38
class ErrorMessage : public Plugin
40
class DRIZZLED_API ErrorMessage : public Plugin
41
43
ErrorMessage(const ErrorMessage &);
42
44
ErrorMessage& operator=(const ErrorMessage &);
44
47
explicit ErrorMessage(std::string name_arg)
45
48
: Plugin(name_arg, "ErrorMessage")
47
50
virtual ~ErrorMessage() {}
49
virtual bool errmsg(Session *session, int priority,
50
const char *format, va_list ap)=0;
52
virtual bool errmsg(error::level_t priority, const char *format, va_list ap)=0;
52
54
static bool addPlugin(plugin::ErrorMessage *handler);
53
55
static void removePlugin(plugin::ErrorMessage *handler);
55
static bool vprintf(Session *session, int priority, char const *format,
57
static bool vprintf(error::level_t priority, char const *format, va_list ap);
59
bool removeLast() const
59
65
} /* namespace plugin */