summaryrefslogtreecommitdiff
path: root/ndb/include/logger
diff options
context:
space:
mode:
authorunknown <stewart@mysql.com>2006-01-13 11:43:50 +1100
committerunknown <stewart@mysql.com>2006-01-13 11:43:50 +1100
commitba3086a2d25db49eee788bdc241de799afd769c2 (patch)
tree3366c3749e0a36705bcd8c05d626cfbd73cd398d /ndb/include/logger
parent31ff9e9a1077d24287a36a3ff1e9e946e11a6a38 (diff)
downloadmariadb-git-ba3086a2d25db49eee788bdc241de799afd769c2.tar.gz
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
Diffstat (limited to 'ndb/include/logger')
-rw-r--r--ndb/include/logger/LogHandler.hpp13
-rw-r--r--ndb/include/logger/Logger.hpp5
2 files changed, 17 insertions, 1 deletions
diff --git a/ndb/include/logger/LogHandler.hpp b/ndb/include/logger/LogHandler.hpp
index 7df6ad864e5..8b9aa43d7a9 100644
--- a/ndb/include/logger/LogHandler.hpp
+++ b/ndb/include/logger/LogHandler.hpp
@@ -126,6 +126,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
*
* @param params list of parameters, formatted as "param=value",
@@ -195,6 +207,7 @@ private:
const char* m_pDateTimeFormat;
int m_errorCode;
+ char* m_errorStr;
// for handling repeated messages
unsigned m_count_repeated_messages;
diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp
index ee762098fb6..3414468d42d 100644
--- a/ndb/include/logger/Logger.hpp
+++ b/ndb/include/logger/Logger.hpp
@@ -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.