~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/logging.h

  • Committer: Monty Taylor
  • Date: 2009-09-30 07:01:32 UTC
  • mto: This revision was merged to the branch mainline in revision 1184.
  • Revision ID: mordred@inaugust.com-20090930070132-b1ol1xu1rpajdddy
Small namespace cleanup.

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
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
23
22
#ifndef DRIZZLED_PLUGIN_LOGGING_H
24
23
#define DRIZZLED_PLUGIN_LOGGING_H
25
24
 
26
 
typedef struct logging_st
27
 
{
28
 
  bool (*logging_pre)(Session *session);
29
 
  bool (*logging_post)(Session *session);
30
 
} logging_t;
 
25
#include <string>
 
26
 
 
27
namespace drizzled
 
28
{
 
29
namespace plugin
 
30
{
 
31
 
 
32
class Logging : public Plugin
 
33
{
 
34
  Logging();
 
35
  Logging(const Logging &);
 
36
public:
 
37
  explicit Logging(std::string name_arg): Plugin(name_arg)  {}
 
38
  virtual ~Logging() {}
 
39
 
 
40
  /**
 
41
   * Make these no-op rather than pure-virtual so that it's easy for a plugin
 
42
   * to only implement one.
 
43
   */
 
44
  virtual bool pre(Session *) {return false;}
 
45
  virtual bool post(Session *) {return false;}
 
46
 
 
47
  static void add(Logging *handler);
 
48
  static void remove(Logging *handler);
 
49
  static bool pre_do(Session *session);
 
50
  static bool post_do(Session *session);
 
51
};
 
52
 
 
53
} /* namespace plugin */
 
54
} /* namespace drizzled */
31
55
 
32
56
#endif /* DRIZZLED_PLUGIN_LOGGING_H */