~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/syslog/module.cc

  • Committer: Brian Aker
  • Date: 2011-10-18 17:07:03 UTC
  • mto: This revision was merged to the branch mainline in revision 2444.
  • Revision ID: brian@tangent.org-20111018170703-cwtp14k5tykbp2xz
Enable syslog and format sql_select

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <drizzled/plugin/error_message.h>
25
25
#include <drizzled/plugin/function.h>
26
26
 
27
 
#include "wrap.h"
28
 
#include "logging.h"
29
 
#include "errmsg.h"
30
 
#include "function.h"
 
27
#include <plugin/syslog/wrap.h>
 
28
#include <plugin/syslog/logging.h>
 
29
#include <plugin/syslog/errmsg.h>
 
30
#include <plugin/syslog/function.h>
31
31
#include <iostream>
32
32
#include <boost/program_options.hpp>
33
33
#include <drizzled/module/option_map.h>
39
39
namespace drizzle_plugin
40
40
{
41
41
 
42
 
bool sysvar_logging_enable= false;
43
 
bool sysvar_errmsg_enable= false;
 
42
static bool sysvar_logging_enable= false;
 
43
static bool sysvar_errmsg_enable= true;
44
44
 
45
45
uint64_constraint sysvar_logging_threshold_slow;
46
46
uint64_constraint sysvar_logging_threshold_big_resultset;
57
57
    context.add(new error_message::Syslog(vm["facility"].as<string>(),
58
58
                                          vm["errmsg-priority"].as<string>()));
59
59
  }
 
60
 
60
61
  if (sysvar_logging_enable)
61
62
  {
62
63
    context.add(new logging::Syslog(vm["facility"].as<string>(),
65
66
                                    sysvar_logging_threshold_big_resultset.get(),
66
67
                                    sysvar_logging_threshold_big_examined.get()));
67
68
  }
 
69
 
68
70
  context.add(new plugin::Create_function<udf::Syslog>("syslog"));
69
71
 
70
72
  context.registerVariable(new sys_var_const_string_val("facility",
112
114
          po::value<uint64_constraint>(&sysvar_logging_threshold_big_examined)->default_value(0),
113
115
          _("Threshold for logging big queries, for rows examined"));
114
116
  context("errmsg-enable",
115
 
          po::value<bool>(&sysvar_errmsg_enable)->default_value(false)->zero_tokens(),
 
117
          po::value<bool>(&sysvar_errmsg_enable)->default_value(true)->zero_tokens(),
116
118
          _("Enable logging to syslog of the error messages"));
117
119
  context("errmsg-priority",
118
120
          po::value<string>()->default_value("warning"),