~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/syslog/errmsg.cc

  • Committer: Brian Aker
  • Date: 2011-10-19 19:30:54 UTC
  • mto: This revision was merged to the branch mainline in revision 2444.
  • Revision ID: brian@tangent.org-20111019193054-pxnb4hflrmbfhmbm
Fix level_t to be more inline with syslog

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
  {
44
42
    _facility= WrapSyslog::getFacilityByName("local0");
45
43
  }
46
44
 
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
 
 
55
45
  std::cerr << "Starting syslog with " << _facility << std::endl;
56
46
}
57
47
 
58
 
bool error_message::Syslog::errmsg(drizzled::error::level_t, const char *format, va_list ap)
 
48
bool error_message::Syslog::errmsg(drizzled::error::level_t priority, const char *format, va_list ap)
59
49
{
60
 
  WrapSyslog::singleton().vlog(_facility, _priority, format, ap);
 
50
  WrapSyslog::singleton().vlog(_facility, priority, format, ap);
61
51
  return false;
62
52
}
63
53