~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/logging.h

  • Committer: Brian Aker
  • Date: 2009-10-02 19:38:12 UTC
  • mfrom: (1152.1.7 merge)
  • Revision ID: brian@gaz-20091002193812-mpd61oecep74t6gd
Merge Monty + Brian for plugins.

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
 
 
 
3
 *
5
4
 *  Definitions required for Query Logging plugin
6
 
 
 
5
 *
7
6
 *  Copyright (C) 2008 Sun Microsystems
8
7
 *
9
8
 *  This program is free software; you can redistribute it and/or modify
25
24
 
26
25
#include <string>
27
26
 
28
 
class Logging_handler
 
27
namespace drizzled
 
28
{
 
29
namespace plugin
 
30
{
 
31
 
 
32
class Logging
29
33
{
30
34
  std::string name;
31
35
public:
32
 
  Logging_handler(std::string name_arg): name(name_arg)  {}
33
 
  Logging_handler(const char *name_arg): name(name_arg)  {}
34
 
  virtual ~Logging_handler() {}
 
36
  Logging(std::string name_arg): name(name_arg)  {}
 
37
  virtual ~Logging() {}
35
38
 
36
39
  std::string getName() { return name; }
37
40
  /**
38
41
   * Make these no-op rather than pure-virtual so that it's easy for a plugin
39
 
   * to only 
 
42
   * to only implement one.
40
43
   */
41
44
  virtual bool pre(Session *) {return false;}
42
45
  virtual bool post(Session *) {return false;}
 
46
 
 
47
  static bool addPlugin(Logging *handler);
 
48
  static void removePlugin(Logging *handler);
 
49
  static bool preDo(Session *session);
 
50
  static bool postDo(Session *session);
43
51
};
44
52
 
 
53
} /* namespace plugin */
 
54
} /* namespace drizzled */
 
55
 
45
56
#endif /* DRIZZLED_PLUGIN_LOGGING_H */