~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_gearman/logging_gearman.cc

  • Committer: Brian Aker
  • Date: 2010-07-19 21:09:30 UTC
  • mfrom: (1662.1.3 rollup)
  • Revision ID: brian@gaz-20100719210930-jikrvg3zjfxe41cw
Rolloup patch for Brian, Monty, VJ. Fixes debug build for PBMS, and merges
in additional changes for using boost.

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>
31
32
#include <cstdio>
32
33
 
33
34
using namespace drizzled;
34
 
 
 
35
namespace po= boost::program_options;
35
36
 
36
37
/* TODO make this dynamic as needed */
37
38
static const int MAX_MSG_LEN= 32*1024;
38
39
 
39
 
static bool sysvar_logging_gearman_enable= false;
 
40
static bool sysvar_logging_gearman_enable;
40
41
static char* sysvar_logging_gearman_host= NULL;
41
42
static char* sysvar_logging_gearman_function= NULL;
42
43
 
298
299
  return 0;
299
300
}
300
301
 
 
302
static void init_options(drizzled::module::option_context &context)
 
303
{
 
304
  context("enable",
 
305
          po::value<bool>(&sysvar_logging_gearman_enable)->default_value(false)->zero_tokens(),
 
306
          N_("Enable logging to a gearman server"));
 
307
}
 
308
 
301
309
static DRIZZLE_SYSVAR_BOOL(
302
310
                           enable,
303
311
                           sysvar_logging_gearman_enable,
335
343
DRIZZLE_DECLARE_PLUGIN
336
344
{
337
345
  DRIZZLE_VERSION_ID,
338
 
    "logging_gearman",
 
346
    "logging-gearman",
339
347
    "0.1",
340
348
    "Mark Atwood <mark@fallenpegasus.com>",
341
349
    N_("Log queries to a Gearman server"),
342
350
    PLUGIN_LICENSE_GPL,
343
351
    logging_gearman_plugin_init,
344
352
    logging_gearman_system_variables,
345
 
    NULL
 
353
    init_options
346
354
}
347
355
DRIZZLE_DECLARE_PLUGIN_END;