~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/logging_handler.h

Reverted 1103

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
1
/*
 
2
 -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
3
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
 
4
 
4
5
 *  Definitions required for Query Logging plugin
5
 
 *
6
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
6
 
 
7
 *  Copyright (C) 2008 Sun Microsystems
7
8
 *
8
9
 *  This program is free software; you can redistribute it and/or modify
9
10
 *  it under the terms of the GNU General Public License as published by
22
23
#ifndef DRIZZLED_PLUGIN_LOGGING_H
23
24
#define DRIZZLED_PLUGIN_LOGGING_H
24
25
 
25
 
#include "drizzled/plugin/plugin.h"
26
 
 
27
26
#include <string>
28
27
 
29
 
#include "drizzled/visibility.h"
30
 
 
31
 
namespace drizzled
32
 
{
33
 
class Session;
34
 
 
35
 
namespace plugin
36
 
{
37
 
 
38
 
class DRIZZLED_API Logging : public Plugin
39
 
{
40
 
  Logging();
41
 
  Logging(const Logging &);
42
 
  Logging& operator=(const Logging &);
 
28
class Logging_handler
 
29
{
 
30
  std::string name;
43
31
public:
44
 
  explicit Logging(std::string name_arg)
45
 
    : Plugin(name_arg, "Logging")
46
 
  {}
47
 
  virtual ~Logging() {}
 
32
  Logging_handler(std::string name_arg): name(name_arg)  {}
 
33
  Logging_handler(const char *name_arg): name(name_arg)  {}
 
34
  virtual ~Logging_handler() {}
48
35
 
 
36
  std::string getName() { return name; }
49
37
  /**
50
38
   * Make these no-op rather than pure-virtual so that it's easy for a plugin
51
 
   * to only implement one.
 
39
   * to only 
52
40
   */
53
41
  virtual bool pre(Session *) {return false;}
54
42
  virtual bool post(Session *) {return false;}
55
 
  virtual bool postEnd(Session*) {return false;}
56
 
  virtual bool resetGlobalScoreboard() {return false;}
57
 
 
58
 
  static bool addPlugin(Logging *handler);
59
 
  static void removePlugin(Logging *handler);
60
 
  static bool preDo(Session *session);
61
 
  static bool postDo(Session *session);
62
 
  static bool postEndDo(Session *session);
63
 
  static bool resetStats(Session *session);
64
43
};
65
44
 
66
 
} /* namespace plugin */
67
 
} /* namespace drizzled */
68
 
 
69
45
#endif /* DRIZZLED_PLUGIN_LOGGING_H */