~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/error_message.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:
76
76
              _("errmsg plugin '%s' errmsg() failed"),
77
77
              handler->getName().c_str());
78
78
      va_end(handler_ap);
 
79
 
79
80
      return true;
80
81
    }
81
82
    va_end(handler_ap);
86
87
 
87
88
bool plugin::ErrorMessage::vprintf(error::level_t priority, char const *format, va_list ap)
88
89
{
89
 
  if (not (priority >= error::verbosity()))
 
90
  if (priority > error::verbosity())
 
91
  {
90
92
    return false;
 
93
  }
91
94
 
92
95
  /* 
93
96
    Check to see if any errmsg plugin has been loaded
94
97
    if not, just fall back to emitting the message to stderr.
95
98
  */
96
 
  if (not all_errmsg_handler.size())
 
99
  if (all_errmsg_handler.size() == 0)
97
100
  {
98
101
    /* if it turns out that the vfprintf doesnt do one single write
99
 
       (single writes are atomic), then this needs to be rewritten to
100
 
       vsprintf into a char buffer, and then write() that char buffer
101
 
       to stderr */
102
 
      vfprintf(stderr, format, ap);
103
 
      fputc('\n', stderr);
 
102
      (single writes are atomic), then this needs to be rewritten to
 
103
      vsprintf into a char buffer, and then write() that char buffer
 
104
      to stderr 
 
105
    */
 
106
    vfprintf(stderr, format, ap);
 
107
    fputc('\n', stderr);
 
108
 
104
109
    return false;
105
110
  }
106
111