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:
5
4
* Definitions required for Query Logging plugin
7
6
* Copyright (C) 2008 Sun Microsystems
9
8
* This program is free software; you can redistribute it and/or modify
23
22
#ifndef DRIZZLED_PLUGIN_LOGGING_H
24
23
#define DRIZZLED_PLUGIN_LOGGING_H
25
#include "drizzled/plugin/plugin.h"
36
class Logging : public Plugin
39
Logging(const Logging &);
40
Logging& operator=(const 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() {}
42
explicit Logging(std::string name_arg)
43
: Plugin(name_arg, "Logging")
36
std::string getName() { return name; }
38
48
* Make these no-op rather than pure-virtual so that it's easy for a plugin
49
* to only implement one.
41
51
virtual bool pre(Session *) {return false;}
42
52
virtual bool post(Session *) {return false;}
53
virtual bool postEnd(Session*) {return false;}
55
static bool addPlugin(Logging *handler);
56
static void removePlugin(Logging *handler);
57
static bool preDo(Session *session);
58
static bool postDo(Session *session);
59
static bool postEndDo(Session *session);
62
} /* namespace plugin */
63
} /* namespace drizzled */
45
65
#endif /* DRIZZLED_PLUGIN_LOGGING_H */