~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/syslog/errmsg.cc

  • Committer: Mark Atwood
  • Date: 2011-12-15 23:13:18 UTC
  • mfrom: (2465.3.1 rf3)
  • Revision ID: me@mark.atwood.name-20111215231318-mt2y2q4s5ydp79q3
mergeĀ lp:~olafvdspek/drizzle/refactor14

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <drizzled/gettext.h>
23
23
#include <drizzled/errmsg_print.h>
24
24
 
25
 
#include <stdarg.h>
 
25
#include <cstdarg>
26
26
 
27
 
#include "errmsg.h"
28
 
#include "wrap.h"
 
27
#include <plugin/syslog/errmsg.h>
 
28
#include <plugin/syslog/wrap.h>
29
29
 
30
30
namespace drizzle_plugin
31
31
{
32
32
 
33
 
error_message::Syslog::Syslog(const std::string& facility,
34
 
                              const std::string& priority) :
 
33
error_message::Syslog::Syslog(const std::string& facility) :
35
34
  drizzled::plugin::ErrorMessage("Syslog"),
36
 
  _facility(WrapSyslog::getFacilityByName(facility.c_str())),
37
 
  _priority(WrapSyslog::getPriorityByName(priority.c_str()))
 
35
  _facility(WrapSyslog::getFacilityByName(facility.c_str()))
38
36
{
39
37
  if (_facility == -1)
40
38
  {
43
41
                            facility.c_str());
44
42
    _facility= WrapSyslog::getFacilityByName("local0");
45
43
  }
46
 
 
47
 
  if (_priority == -1)
48
 
  {
49
 
    drizzled::errmsg_printf(drizzled::error::WARN,
50
 
                            _("syslog priority \"%s\" not known, using \"warn\""),
51
 
                            priority.c_str());
52
 
    _priority= WrapSyslog::getPriorityByName("warn");
53
 
  }
54
44
}
55
45
 
56
 
bool error_message::Syslog::errmsg(drizzled::error::level_t, const char *format, va_list ap)
 
46
bool error_message::Syslog::errmsg(drizzled::error::priority_t priority, const char *format, va_list ap)
57
47
{
58
 
  WrapSyslog::singleton().vlog(_facility, _priority, format, ap);
 
48
  WrapSyslog::singleton().vlog(_facility, priority, format, ap);
59
49
  return false;
60
50
}
61
51