20
20
#include <drizzled/server_includes.h>
21
21
#include <drizzled/logging.h>
22
22
#include <drizzled/gettext.h>
23
#include "drizzled/plugin_registry.h"
25
27
using namespace std;
27
29
static vector<Logging_handler *> all_loggers;
29
static void add_logger(Logging_handler *handler)
31
all_loggers.push_back(handler);
34
static void remove_logger(Logging_handler *handler)
36
all_loggers.erase(find(all_loggers.begin(), all_loggers.end(), handler));
39
int logging_initializer(st_plugin_int *plugin)
41
Logging_handler *p= NULL;
43
if (plugin->plugin->init)
45
if (plugin->plugin->init(&p))
47
/* TRANSLATORS: The leading word "logging" is the name
48
of the plugin api, and so should not be translated. */
49
errmsg_printf(ERRMSG_LVL_ERROR, "logging plugin '%s' init() failed",
63
int logging_finalizer(st_plugin_int *plugin)
65
Logging_handler *p = static_cast<Logging_handler *>(plugin->data);
71
if (plugin->plugin->deinit)
73
if (plugin->plugin->deinit((void *)p))
75
/* TRANSLATORS: The leading word "logging" is the name
76
of the plugin api, and so should not be translated. */
77
errmsg_printf(ERRMSG_LVL_ERROR, _("logging plugin '%s' deinit() failed"),
31
void add_logger(Logging_handler *handler)
34
all_loggers.push_back(handler);
37
void remove_logger(Logging_handler *handler)
40
all_loggers.erase(find(all_loggers.begin(), all_loggers.end(), handler));
86
44
class LoggingPreIterate : public unary_function<Logging_handler *, bool>