~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin_logging.h

  • Committer: Mark Atwood
  • Date: 2008-10-03 01:39:40 UTC
  • mto: This revision was merged to the branch mainline in revision 437.
  • Revision ID: mark@fallenpegasus.com-20081003013940-mvefjo725dltz41h
rename logging_noop to logging_query

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Definitions required for Query Logging plugin
5
 
 *
6
 
 *  Copyright (C) 2008 Sun Microsystems
7
 
 *
8
 
 *  This program is free software; you can redistribute it and/or modify
9
 
 *  it under the terms of the GNU General Public License as published by
10
 
 *  the Free Software Foundation; version 2 of the License.
11
 
 *
12
 
 *  This program is distributed in the hope that it will be useful,
13
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 *  GNU General Public License for more details.
16
 
 *
17
 
 *  You should have received a copy of the GNU General Public License
18
 
 *  along with this program; if not, write to the Free Software
19
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
 
 */
 
1
/*
 
2
  Definitions required for Logging plugin 
 
3
*/
21
4
 
22
5
#ifndef DRIZZLED_PLUGIN_LOGGING_H
23
6
#define DRIZZLED_PLUGIN_LOGGING_H
24
7
 
25
 
#include "drizzled/plugin/plugin.h"
26
 
 
27
 
#include <string>
28
 
 
29
 
namespace drizzled
30
 
{
31
 
class Session;
32
 
 
33
 
namespace plugin
34
 
{
35
 
 
36
 
class Logging : public Plugin
37
 
{
38
 
  Logging();
39
 
  Logging(const Logging &);
40
 
  Logging& operator=(const Logging &);
41
 
public:
42
 
  explicit Logging(std::string name_arg)
43
 
    : Plugin(name_arg, "Logging")
44
 
  {}
45
 
  virtual ~Logging() {}
46
 
 
47
 
  /**
48
 
   * Make these no-op rather than pure-virtual so that it's easy for a plugin
49
 
   * to only implement one.
50
 
   */
51
 
  virtual bool pre(Session *) {return false;}
52
 
  virtual bool post(Session *) {return false;}
53
 
  virtual bool postEnd(Session*) {return false;}
54
 
  virtual bool resetGlobalScoreboard() {return false;}
55
 
 
56
 
  static bool addPlugin(Logging *handler);
57
 
  static void removePlugin(Logging *handler);
58
 
  static bool preDo(Session *session);
59
 
  static bool postDo(Session *session);
60
 
  static bool postEndDo(Session *session);
61
 
  static bool resetStats(Session *session);
62
 
};
63
 
 
64
 
} /* namespace plugin */
65
 
} /* namespace drizzled */
 
8
typedef struct logging_st
 
9
{
 
10
  bool (*logging_pre)(THD *thd);
 
11
  bool (*logging_post)(THD *thd);
 
12
} logging_t;
66
13
 
67
14
#endif /* DRIZZLED_PLUGIN_LOGGING_H */