~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_gearman/logging_gearman.cc

Remove dead memset call.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <drizzled/plugin/logging.h>
22
22
#include <drizzled/gettext.h>
23
23
#include <drizzled/session.h>
24
 
 
 
24
#include <boost/program_options.hpp>
 
25
#include <drizzled/module/option_map.h>
25
26
#include <libgearman/gearman.h>
26
27
#include <limits.h>
27
28
#include <sys/time.h>
28
29
#include <sys/types.h>
29
30
#include <sys/stat.h>
30
31
#include <fcntl.h>
31
 
 
 
32
#include <cstdio>
 
33
#include <cerrno>
32
34
 
33
35
using namespace drizzled;
34
 
 
 
36
namespace po= boost::program_options;
35
37
 
36
38
/* TODO make this dynamic as needed */
37
39
static const int MAX_MSG_LEN= 32*1024;
38
40
 
39
 
static bool sysvar_logging_gearman_enable= false;
 
41
static bool sysvar_logging_gearman_enable;
40
42
static char* sysvar_logging_gearman_host= NULL;
41
43
static char* sysvar_logging_gearman_function= NULL;
42
44
 
192
194
 
193
195
    if (gearman_client_create(&gearman_client) == NULL)
194
196
    {
 
197
      char errmsg[STRERROR_MAX];
 
198
      strerror_r(errno, errmsg, sizeof(errmsg));
195
199
      errmsg_printf(ERRMSG_LVL_ERROR, _("fail gearman_client_create(): %s"),
196
 
                    strerror(errno));
 
200
                    errmsg);
197
201
      return;
198
202
    }
199
203
 
290
294
 
291
295
static LoggingGearman *handler= NULL;
292
296
 
293
 
static int logging_gearman_plugin_init(plugin::Context &context)
 
297
static int logging_gearman_plugin_init(module::Context &context)
294
298
{
295
299
  handler= new LoggingGearman();
296
300
  context.add(handler);
298
302
  return 0;
299
303
}
300
304
 
 
305
static void init_options(drizzled::module::option_context &context)
 
306
{
 
307
  context("enable",
 
308
          po::value<bool>(&sysvar_logging_gearman_enable)->default_value(false)->zero_tokens(),
 
309
          N_("Enable logging to a gearman server"));
 
310
}
 
311
 
301
312
static DRIZZLE_SYSVAR_BOOL(
302
313
                           enable,
303
314
                           sysvar_logging_gearman_enable,
335
346
DRIZZLE_DECLARE_PLUGIN
336
347
{
337
348
  DRIZZLE_VERSION_ID,
338
 
    "logging_gearman",
 
349
    "logging-gearman",
339
350
    "0.1",
340
351
    "Mark Atwood <mark@fallenpegasus.com>",
341
352
    N_("Log queries to a Gearman server"),
342
353
    PLUGIN_LICENSE_GPL,
343
354
    logging_gearman_plugin_init,
344
355
    logging_gearman_system_variables,
345
 
    NULL
 
356
    init_options
346
357
}
347
358
DRIZZLE_DECLARE_PLUGIN_END;