~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/logging.h

  • Committer: Daniel Nichter
  • Date: 2011-10-23 16:01:37 UTC
  • mto: This revision was merged to the branch mainline in revision 2448.
  • Revision ID: daniel@percona.com-20111023160137-7ac3blgz8z4tf8za
Add Administration Getting Started and Logging.  Capitalize SQL clause keywords.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
3
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
 
 
5
 
 *  Definitions required for Query Logging plugin 
6
 
 
7
 
 *  Copyright (C) 2008 Mark Atwood
 
3
 *
 
4
 *  Definitions required for Query Logging plugin
 
5
 *
 
6
 *  Copyright (C) 2008 Sun Microsystems, Inc.
8
7
 *
9
8
 *  This program is free software; you can redistribute it and/or modify
10
9
 *  it under the terms of the GNU General Public License as published by
20
19
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21
20
 */
22
21
 
23
 
#ifndef DRIZZLED_PLUGIN_LOGGING_H
24
 
#define DRIZZLED_PLUGIN_LOGGING_H
25
 
 
26
 
typedef struct logging_st
 
22
#pragma once
 
23
 
 
24
#include <drizzled/plugin/plugin.h>
 
25
#include <drizzled/visibility.h>
 
26
 
 
27
namespace drizzled {
 
28
namespace plugin {
 
29
 
 
30
class DRIZZLED_API Logging : public Plugin
27
31
{
28
 
  bool (*logging_pre)(Session *session);
29
 
  bool (*logging_post)(Session *session);
30
 
} logging_t;
31
 
 
32
 
#endif /* DRIZZLED_PLUGIN_LOGGING_H */
 
32
public:
 
33
  explicit Logging(std::string name_arg)
 
34
    : Plugin(name_arg, "Logging")
 
35
  {}
 
36
 
 
37
  /**
 
38
   * Make these no-op rather than pure-virtual so that it's easy for a plugin
 
39
   * to only implement one.
 
40
   */
 
41
  virtual bool pre(Session *) {return false;}
 
42
  virtual bool post(Session *) {return false;}
 
43
  virtual bool postEnd(Session*) {return false;}
 
44
  virtual bool resetGlobalScoreboard() {return false;}
 
45
 
 
46
  static bool addPlugin(Logging *handler);
 
47
  static void removePlugin(Logging *handler);
 
48
  static bool preDo(Session *session);
 
49
  static bool postDo(Session *session);
 
50
  static bool postEndDo(Session *session);
 
51
  static bool resetStats(Session *session);
 
52
};
 
53
 
 
54
} /* namespace plugin */
 
55
} /* namespace drizzled */
 
56