summaryrefslogtreecommitdiff
path: root/ndb/include/debugger
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-09-16 18:02:41 +0200
committerunknown <joreland@mysql.com>2004-09-16 18:02:41 +0200
commit2468e5ba46dd94ffbf75298d01141b56e7783589 (patch)
tree577103ea480f01ddd421ebd50012b8e98596be5a /ndb/include/debugger
parent3e78c89ed4e4e7d7e9809fad7f08de425850618c (diff)
downloadmariadb-git-2468e5ba46dd94ffbf75298d01141b56e7783589.tar.gz
wl1668 -
Add support for getting events via mgmapi removed all traces of stat port BitKeeper/deleted/.del-NodeLogLevel.cpp~324045b93af7123b: Delete: ndb/src/mgmsrv/NodeLogLevel.cpp BitKeeper/deleted/.del-NodeLogLevel.hpp~4f4ab0fe52fb497c: Delete: ndb/src/mgmsrv/NodeLogLevel.hpp BitKeeper/deleted/.del-NodeLogLevelList.cpp~97dc9c909e3e92bf: Delete: ndb/src/mgmsrv/NodeLogLevelList.cpp BitKeeper/deleted/.del-NodeLogLevelList.hpp~ef567dd850abddc7: Delete: ndb/src/mgmsrv/NodeLogLevelList.hpp ndb/include/debugger/EventLogger.hpp: Split EventLogger into two classes ndb/include/kernel/LogLevel.hpp: Add some nice to have methods + use uint8 for storage ndb/include/kernel/signaldata/EventSubscribeReq.hpp: operator= ndb/include/kernel/signaldata/SetLogLevelOrd.hpp: operator= ndb/include/mgmapi/mgmapi.h: remove deprecated vars ndb/src/common/debugger/EventLogger.cpp: Split into 2 ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Remove hardcoded mgm stuff ndb/src/mgmsrv/CommandInterpreter.cpp: #if 0 some deprecated code ndb/src/mgmsrv/Makefile.am: remove NodeLogLevel* ndb/src/mgmsrv/MgmtSrvr.cpp: Remove dead code Handle multiple event listeners in mgmapi ndb/src/mgmsrv/MgmtSrvr.hpp: Remove dead code Handle multiple event listeners in mgmapi ndb/src/mgmsrv/Services.cpp: listen event method in mgmapi ndb/src/mgmsrv/Services.hpp: listen event method in mgmapi ndb/src/mgmsrv/main.cpp: remove stat port
Diffstat (limited to 'ndb/include/debugger')
-rw-r--r--ndb/include/debugger/EventLogger.hpp167
1 files changed, 72 insertions, 95 deletions
diff --git a/ndb/include/debugger/EventLogger.hpp b/ndb/include/debugger/EventLogger.hpp
index 6cd6a83e68d..36cece6f22a 100644
--- a/ndb/include/debugger/EventLogger.hpp
+++ b/ndb/include/debugger/EventLogger.hpp
@@ -24,6 +24,65 @@
#include <kernel/LogLevel.hpp>
#include <signaldata/EventReport.hpp>
+class EventLoggerBase {
+public:
+ virtual ~EventLoggerBase();
+
+ /**
+ * LogLevel settings
+ */
+ LogLevel m_logLevel;
+
+ /**
+ * Find a category matching the string
+ *
+ * @param str string to match.
+ * @param cat the event category.
+ * @param exactMatch only do exact matching.
+ *
+ * @return TRUE if match is found, then cat is modified
+ * FALSE if match is not found
+ */
+ static bool matchEventCategory(const char * str,
+ LogLevel::EventCategory * cat,
+ bool exactMatch = false);
+
+ /**
+ * Returns category name or NULL if not found.
+ *
+ * @param cat the event category.
+ * @return category name.
+ */
+ static const char * getEventCategoryName(LogLevel::EventCategory cat);
+
+ /**
+ * Specifies allowed event categories/log levels.
+ */
+ struct EventCategoryName {
+ LogLevel::EventCategory category;
+ const char * name;
+ };
+
+ static const EventCategoryName eventCategoryNames[];
+ static const Uint32 noOfEventCategoryNames;
+
+ /**
+ * This matrix defines which event should be printed when
+ *
+ * threshold - is in range [0-15]
+ * severity - DEBUG to ALERT (Type of log message)
+ */
+ struct EventRepLogLevelMatrix {
+ EventReport::EventType eventType;
+ LogLevel::EventCategory eventCategory;
+ Uint32 threshold;
+ Logger::LoggerLevel severity;
+ };
+
+ static const EventRepLogLevelMatrix matrix[];
+ static const Uint32 matrixSize;
+};
+
/**
* The EventLogger is primarily used for logging NDB events
* in the Management Server. It inherits all logging functionality of Logger.
@@ -58,7 +117,7 @@
* @see Logger
* @version #@ $Id: EventLogger.hpp,v 1.3 2003/09/01 10:15:52 innpeno Exp $
*/
-class EventLogger : public Logger
+class EventLogger : public EventLoggerBase, public Logger
{
public:
/**
@@ -70,7 +129,7 @@ public:
/**
* Destructor.
*/
- ~EventLogger();
+ virtual ~EventLogger();
/**
* Opens/creates the eventlog with the specified filename.
@@ -95,30 +154,23 @@ public:
/**
* Logs the NDB event.
*
- * @param nodeId the node id of event origin.
- * @param eventType the type of event.
- * @param theData the event data.
- * @deprecated use log(int eventType, const Uint32* theData, NodeId nodeId)
- */
- void log(NodeId nodeId, int eventType, const Uint32* theData);
-
- /**
- * Logs the NDB event.
- *
* @param eventType the type of event.
* @param theData the event data.
* @param nodeId the node id of event origin.
*/
- void log(int eventType, const Uint32* theData, NodeId nodeId = 0);
+ virtual void log(int eventType, const Uint32* theData, NodeId nodeId = 0);
/**
- * Returns the current log levels.
- * Enable, disable log levels to filter the events that are sent to the
- * eventlog.
+ * Returns the event text for the specified event report type.
*
- * @return the log level.
+ * @param type the event type.
+ * @param theData the event data.
+ * @param nodeId a node id.
+ * @return the event report text.
*/
- LogLevel& getLoglevel();
+ static const char* getText(char * dst, size_t dst_len,
+ int type,
+ const Uint32* theData, NodeId nodeId = 0);
/**
* Returns the log level that is used to filter an event. The event will not
@@ -127,6 +179,7 @@ public:
* @return the log level filter that is used for all event categories.
*/
int getFilterLevel() const;
+
/**
* Sets log level filter. The event will be logged if
* the event category's log level is <= 'filterLevel'.
@@ -135,92 +188,16 @@ public:
*/
void setFilterLevel(int filterLevel);
- /**
- * Returns the event text for the specified event report type.
- *
- * @param type the event type.
- * @param theData the event data.
- * @param nodeId a node id.
- * @return the event report text.
- */
- static const char* getText(int type,
- const Uint32* theData, NodeId nodeId = 0);
-
- /**
- * Find a category matching the string
- *
- * @param str string to match.
- * @param cat the event category.
- * @param exactMatch only do exact matching.
- *
- * @return TRUE if match is found, then cat is modified
- * FALSE if match is not found
- */
- static bool matchEventCategory(const char * str,
- LogLevel::EventCategory * cat,
- bool exactMatch = false);
-
- /**
- * Returns category name or NULL if not found.
- *
- * @param cat the event category.
- * @return category name.
- */
- static const char * getEventCategoryName(LogLevel::EventCategory cat);
-
- /**
- * Specifies allowed event categories/log levels.
- */
- struct EventCategoryName {
- LogLevel::EventCategory category;
- const char * name;
- };
-
- static const EventCategoryName eventCategoryNames[];
- static const Uint32 noOfEventCategoryNames;
-
- /**
- * This matrix defines which event should be printed when
- *
- * threshold - is in range [0-15]
- * severity - DEBUG to ALERT (Type of log message)
- */
- struct EventRepLogLevelMatrix {
- EventReport::EventType eventType;
- LogLevel::EventCategory eventCategory;
- Uint32 threshold;
- Logger::LoggerLevel severity;
- };
-
- static const EventRepLogLevelMatrix matrix[];
-
- /**
- * Default log levels for management nodes.
- *
- * threshold - is in range [0-15]
- */
- struct EventLogMatrix {
- LogLevel::EventCategory eventCategory;
- Uint32 threshold;
- };
-
- static const EventLogMatrix defEventLogMatrix[];
-
-
- static const Uint32 matrixSize;
- static const Uint32 defEventLogMatrixSize;
-
private:
/** Prohibit */
EventLogger(const EventLogger&);
EventLogger operator = (const EventLogger&);
bool operator == (const EventLogger&);
- LogLevel m_logLevel;
Uint32 m_filterLevel;
STATIC_CONST(MAX_TEXT_LENGTH = 256);
- static char m_text[MAX_TEXT_LENGTH];
+ char m_text[MAX_TEXT_LENGTH];
};