00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include <drizzled/plugin/plugin.h>
00025 #include <drizzled/error/level_t.h>
00026
00027 #include <stdarg.h>
00028
00029 #include <string>
00030
00031 #include <drizzled/visibility.h>
00032
00033 namespace drizzled
00034 {
00035
00036 namespace plugin
00037 {
00038
00039 class DRIZZLED_API ErrorMessage : public Plugin
00040 {
00041 ErrorMessage();
00042 ErrorMessage(const ErrorMessage &);
00043 ErrorMessage& operator=(const ErrorMessage &);
00044
00045 public:
00046 explicit ErrorMessage(std::string name_arg)
00047 : Plugin(name_arg, "ErrorMessage")
00048 {}
00049 virtual ~ErrorMessage() {}
00050
00051 virtual bool errmsg(error::level_t priority, const char *format, va_list ap)=0;
00052
00053 static bool addPlugin(plugin::ErrorMessage *handler);
00054 static void removePlugin(plugin::ErrorMessage *handler);
00055
00056 static bool vprintf(error::level_t priority, char const *format, va_list ap);
00057
00058 bool removeLast() const
00059 {
00060 return true;
00061 }
00062 };
00063
00064 }
00065 }
00066