~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/logging.cc

  • Committer: Monty Taylor
  • Date: 2008-10-27 23:19:48 UTC
  • mto: (520.4.12 merge-innodb-plugin)
  • mto: This revision was merged to the branch mainline in revision 563.
  • Revision ID: monty@inaugust.com-20081027231948-3kl6ss04plbakqcr
Split some more things out of common_includes.h.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
{
26
26
  logging_t *p;
27
27
 
28
 
  p= new logging_t;
 
28
  p= (logging_t *) malloc(sizeof(logging_t));
29
29
  if (p == NULL) return 1;
30
30
  memset(p, 0, sizeof(logging_t));
31
31
 
37
37
    {
38
38
      /* TRANSLATORS: The leading word "logging" is the name
39
39
         of the plugin api, and so should not be translated. */
40
 
      errmsg_printf(ERRMSG_LVL_ERROR, "logging plugin '%s' init() failed",
 
40
      sql_print_error("logging plugin '%s' init() failed",
41
41
                      plugin->name.str);
42
42
      goto err;
43
43
    }
45
45
  return 0;
46
46
 
47
47
err:
48
 
  delete p;
 
48
  free(p);
49
49
  return 1;
50
50
}
51
51
 
52
52
int logging_finalizer(st_plugin_int *plugin)
53
 
{
 
53
54
54
  logging_t *p = (logging_t *) plugin->data;
55
55
 
56
56
  if (plugin->plugin->deinit)
59
59
    {
60
60
      /* TRANSLATORS: The leading word "logging" is the name
61
61
         of the plugin api, and so should not be translated. */
62
 
      errmsg_printf(ERRMSG_LVL_ERROR, _("logging plugin '%s' deinit() failed"),
 
62
      sql_print_error(_("logging plugin '%s' deinit() failed"),
63
63
                      plugin->name.str);
64
64
    }
65
65
  }
66
66
 
67
 
  if (p) delete p;
 
67
  if (p) free(p);
68
68
 
69
69
  return 0;
70
70
}
82
82
    {
83
83
      /* TRANSLATORS: The leading word "logging" is the name
84
84
         of the plugin api, and so should not be translated. */
85
 
      errmsg_printf(ERRMSG_LVL_ERROR, _("logging plugin '%s' logging_pre() failed"),
 
85
      sql_print_error(_("logging plugin '%s' logging_pre() failed"),
86
86
                      (char *)plugin_name(plugin));
87
87
      return true;
88
88
    }
104
104
}
105
105
 
106
106
/* This gets called by plugin_foreach once for each loaded logging plugin */
107
 
static bool logging_post_iterate (Session *session, plugin_ref plugin,
 
107
static bool logging_post_iterate (Session *session, plugin_ref plugin, 
108
108
                                  void *p __attribute__ ((__unused__)))
109
109
{
110
110
  logging_t *l= plugin_data(plugin, logging_t *);
115
115
    {
116
116
      /* TRANSLATORS: The leading word "logging" is the name
117
117
         of the plugin api, and so should not be translated. */
118
 
      errmsg_printf(ERRMSG_LVL_ERROR, _("logging plugin '%s' logging_post() failed"),
 
118
      sql_print_error(_("logging plugin '%s' logging_post() failed"),
119
119
                      (char *)plugin_name(plugin));
120
120
      return true;
121
121
    }