~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/error_message.h

  • Committer: patrick crews
  • Date: 2011-06-08 03:02:27 UTC
  • mto: This revision was merged to the branch mainline in revision 2329.
  • Revision ID: gleebix@gmail.com-20110608030227-updkyv2652zvfajc
Initial voodoo worked to give us a crashme mode.  Need docs still

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 *  Definitions required for Error Message plugin
5
5
 *
6
 
 *  Copyright (C) 2008 Sun Microsystems
 
6
 *  Copyright (C) 2008 Sun Microsystems, Inc.
7
7
 *
8
8
 *  This program is free software; you can redistribute it and/or modify
9
9
 *  it under the terms of the GNU General Public License as published by
19
19
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
20
 */
21
21
 
22
 
#ifndef DRIZZLED_PLUGIN_ERROR_MESSAGE_H
23
 
#define DRIZZLED_PLUGIN_ERROR_MESSAGE_H
 
22
#pragma once
24
23
 
25
 
#include "drizzled/plugin/plugin.h"
 
24
#include <drizzled/plugin/plugin.h>
 
25
#include <drizzled/error/level_t.h>
26
26
 
27
27
#include <stdarg.h>
28
28
 
29
29
#include <string>
30
30
 
 
31
#include <drizzled/visibility.h>
 
32
 
31
33
namespace drizzled
32
34
{
33
 
class Session;
34
35
 
35
36
namespace plugin
36
37
{
37
38
 
38
 
class ErrorMessage : public Plugin
 
39
class DRIZZLED_API ErrorMessage : public Plugin
39
40
{
40
41
  ErrorMessage();
41
42
  ErrorMessage(const ErrorMessage &);
42
43
  ErrorMessage& operator=(const ErrorMessage &);
 
44
 
43
45
public:
44
46
  explicit ErrorMessage(std::string name_arg)
45
47
   : Plugin(name_arg, "ErrorMessage")
46
48
  {}
47
49
  virtual ~ErrorMessage() {}
48
50
 
49
 
  virtual bool errmsg(Session *session, int priority,
50
 
                      const char *format, va_list ap)=0;
 
51
  virtual bool errmsg(error::level_t priority, const char *format, va_list ap)=0;
51
52
 
52
53
  static bool addPlugin(plugin::ErrorMessage *handler);
53
54
  static void removePlugin(plugin::ErrorMessage *handler);
54
55
 
55
 
  static bool vprintf(Session *session, int priority, char const *format,
56
 
                      va_list ap);
 
56
  static bool vprintf(error::level_t priority, char const *format, va_list ap);
 
57
 
 
58
  bool removeLast() const
 
59
  {
 
60
    return true;
 
61
  }
57
62
};
58
63
 
59
64
} /* namespace plugin */
60
65
} /* namespace drizzled */
61
66
 
62
 
#endif /* DRIZZLED_PLUGIN_ERROR_MESSAGE_H */