BUG#11331 "Warning: could not add log destination" message does not provide enough info

Implement error reporting to Logger and associated classes.


ndb/include/logger/LogHandler.hpp:
  Add error string to LogHandler along with error code
ndb/include/logger/Logger.hpp:
  Add reporting back of error to addHandler(BaseString).
ndb/src/common/logger/FileLogHandler.cpp:
  Implement error reporting
ndb/src/common/logger/LogHandler.cpp:
  Implement error reporting.
  
  Trim spaces and tabs out of parameter names. This allows "p=v, param=value"
ndb/src/common/logger/Logger.cpp:
  Report back errors when adding a handler via BaseString
ndb/src/common/logger/SysLogHandler.cpp:
  Report an error on invalid syslog facility
ndb/src/mgmsrv/MgmtSrvr.cpp:
  Report error when adding log handler
This commit is contained in:
unknown 2006-01-13 11:43:50 +11:00
commit ba3086a2d2
7 changed files with 79 additions and 11 deletions

View file

@ -125,6 +125,18 @@ public:
*/
void setErrorCode(int code);
/**
* Returns the error string.
*/
char* getErrorStr();
/**
* Sets the error string.
*
* @param str the error string.
*/
void setErrorStr(char* str);
/**
* Parse logstring parameters
*
@ -195,6 +207,7 @@ private:
const char* m_pDateTimeFormat;
int m_errorCode;
char* m_errorStr;
// for handling repeated messages
unsigned m_count_repeated_messages;

View file

@ -178,8 +178,11 @@ public:
* Add a new handler
*
* @param logstring string describing the handler to add
* @param err OS errno in event of error
* @param len max length of errStr buffer
* @param errStr logger error string in event of error
*/
bool addHandler(const BaseString &logstring);
bool addHandler(const BaseString &logstring, int *err, int len, char* errStr);
/**
* Remove a log handler.