~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_noop/logging_noop.cc

  • Committer: Mark Atwood
  • Date: 2008-10-03 00:19:31 UTC
  • mto: This revision was merged to the branch mainline in revision 437.
  • Revision ID: mark@fallenpegasus.com-20081003001931-2e91vf12prcu2fuj
start renaming logging_noop to logging_query

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* drizzle/plugin/logging_noop/logging_noop.cc */
 
1
/* drizzle/plugin/logging_query/logging_query.cc */
2
2
 
3
3
/* need to define DRIZZLE_SERVER to get inside the THD */
4
4
#define DRIZZLE_SERVER 1
36
36
};
37
37
 
38
38
 
39
 
bool logging_noop_func_pre (THD *thd)
 
39
bool logging_query_func_pre (THD *thd)
40
40
{
41
41
  char msgbuf[MAX_MSG_LEN];
42
42
  int msgbuf_len = 0;
60
60
  return false;
61
61
}
62
62
 
63
 
bool logging_noop_func_post (THD *thd)
 
63
bool logging_query_func_post (THD *thd)
64
64
{
65
65
  char msgbuf[MAX_MSG_LEN];
66
66
  int msgbuf_len = 0;
88
88
  return false;
89
89
}
90
90
 
91
 
static int logging_noop_plugin_init(void *p)
 
91
static int logging_query_plugin_init(void *p)
92
92
{
93
93
  logging_t *l= (logging_t *) p;
94
94
 
95
 
  l->logging_pre= logging_noop_func_pre;
96
 
  l->logging_post= logging_noop_func_post;
 
95
  l->logging_pre= logging_query_func_pre;
 
96
  l->logging_post= logging_query_func_post;
97
97
 
98
98
  fd= open("/tmp/drizzle.log", O_WRONLY | O_APPEND);
99
99
  if (fd < 0) {
108
108
  return 0;
109
109
}
110
110
 
111
 
static int logging_noop_plugin_deinit(void *p)
 
111
static int logging_query_plugin_deinit(void *p)
112
112
{
113
113
  logging_st *l= (logging_st *) p;
114
114
 
120
120
  return 0;
121
121
}
122
122
 
123
 
mysql_declare_plugin(logging_noop)
 
123
mysql_declare_plugin(logging_query)
124
124
{
125
125
  DRIZZLE_LOGGER_PLUGIN,
126
 
  "logging_noop",
 
126
  "logging_query",
127
127
  "0.1",
128
128
  "Mark Atwood <mark@fallenpegasus.com>",
129
 
  "Logging Plugin Example",
 
129
  "Log queries",
130
130
  PLUGIN_LICENSE_GPL,
131
 
  logging_noop_plugin_init,
132
 
  logging_noop_plugin_deinit,
 
131
  logging_query_plugin_init,
 
132
  logging_query_plugin_deinit,
133
133
  NULL,   /* status variables */
134
134
  NULL,   /* system variables */
135
135
  NULL    /* config options */