1
#include <drizzled/server_includes.h>
2
#include <drizzled/logging.h>
4
int logging_initializer(st_plugin_int *plugin)
8
fprintf(stderr, "MRA %s plugin:%s dl:%s\n",
9
__func__, plugin->name.str, plugin->plugin_dl->dl.str);
11
p= (logging_t *) malloc(sizeof(logging_t));
12
if (p == NULL) return 1;
13
memset(p, 0, sizeof(logging_t));
15
plugin->data= (void *)p;
17
if (plugin->plugin->init)
19
if (plugin->plugin->init((void *)p))
21
sql_print_error("Logging plugin '%s' init function returned error.",
33
int logging_finalizer(st_plugin_int *plugin)
35
logging_t *p = (logging_t *) plugin->data;
37
fprintf(stderr, "MRA %s plugin:%s dl:%s\n",
38
__func__, plugin->name.str, plugin->plugin_dl->dl.str);
40
if (plugin->plugin->deinit)
42
if (plugin->plugin->deinit((void *)p))
44
sql_print_error("Logging plugin '%s' deinit function returned error.",
54
static bool logging_pre_iterate (THD *thd, plugin_ref plugin,
55
void *stuff __attribute__ ((__unused__)))
57
logging_t *l= plugin_data(plugin, logging_t *);
59
if (l && l->logging_pre)
61
if (l->logging_pre(thd))
67
void logging_pre_do (THD *thd)
69
if (plugin_foreach(thd, logging_pre_iterate, DRIZZLE_LOGGER_PLUGIN, NULL))
71
sql_print_error("Logging plugin pre had an error.");
76
static bool logging_post_iterate (THD *thd, plugin_ref plugin,
77
void *stuff __attribute__ ((__unused__)))
79
logging_t *l= plugin_data(plugin, logging_t *);
81
if (l && l->logging_post)
83
if (l->logging_post(thd))
89
void logging_post_do (THD *thd)
91
if (plugin_foreach(thd, logging_post_iterate, DRIZZLE_LOGGER_PLUGIN, NULL))
93
sql_print_error("Logging plugin post had an error.");