List:Commits« Previous MessageNext Message »
From:Olav.Sandstaa Date:March 10 2009 9:35am
Subject:bzr commit into mysql-6.0-falcon-team branch (Olav.Sandstaa:3059)
View as plain text  
#At file:///home/olav/mysql/develop/falcon-elog/ based on revid:christopher.powers@stripped

 3059 Olav.Sandstaa@stripped	2009-03-10
      Extend Falcon's Log class with the following:
      
      1. A new debug mask called LogFatalError:
      
         This debug mask will be on by default for the Falcon log. It will not 
         be disabled if the user provides a debug at startup or changes it for
         a running server.
      
      2. A new log method Log::fatal():
      
         Log messages written using this method will always be written to 
         Falcon/MySQL's log file.

    modified:
      storage/falcon/Log.cpp
      storage/falcon/Log.h
      storage/falcon/ha_falcon.cpp
=== modified file 'storage/falcon/Log.cpp'
--- a/storage/falcon/Log.cpp	2008-04-09 01:36:46 +0000
+++ b/storage/falcon/Log.cpp	2009-03-10 09:35:11 +0000
@@ -119,6 +119,16 @@ void Log::debug(const char *txt, ...)
 	log (LogDebug, txt, args);
 }
 
+void Log::fatal(const char *txt, ...)
+{
+	if (!(activeMask & LogFatalError))
+		return;
+
+	va_list		args;
+	va_start	(args, txt);
+	log (LogFatalError, txt, args);
+}
+
 void Log::debugBreak(const char *txt, ...)
 {
 	if (!(activeMask & LogDebug))

=== modified file 'storage/falcon/Log.h'
--- a/storage/falcon/Log.h	2009-02-12 19:31:23 +0000
+++ b/storage/falcon/Log.h	2009-03-10 09:35:11 +0000
@@ -41,10 +41,17 @@ static const int	LogScrub         = 0x00
 static const int	LogException     = 0x00000100;	// 256;
 static const int	LogScavenge      = 0x00000200;	// 512;
 static const int	LogXARecovery    = 0x00000400;	// 1024;
+static const int	LogFatalError    = 0x00000800;	// 2048;
 static const int	LogMysqlInfo     = 0x20000000;
 static const int	LogMysqlWarning  = 0x40000000;
 static const int	LogMysqlError    = 0x80000000;
 
+// The default mask that will be used if falcon_debug_mask is not set.
+// The debug flag in this mask will always be active independent of what
+// the user sets in the falcon_debug_mask.
+
+static const int	LogDefaultMask   = LogFatalError;
+
 typedef void (Listener) (int, const char*, void *arg);
 
 struct LogListener {
@@ -71,6 +78,7 @@ public:
 	static void addListener (int mask, Listener *fn, void *arg);
 	static void print (int mask, const char *text, void *arg);
 	static void debug (const char *txt, ...);
+	static void fatal (const char *txt, ...);
 	static void log (const char *txt, ...);
 	static void setExclusive(void);
 	static void releaseExclusive(void);

=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp	2009-03-05 10:51:03 +0000
+++ b/storage/falcon/ha_falcon.cpp	2009-03-10 09:35:11 +0000
@@ -246,7 +246,8 @@ int StorageInterface::falcon_init(void *
 	//falcon_hton->show_status  = StorageInterface::show_status;
 	falcon_hton->flags = HTON_NO_FLAGS;
 	falcon_debug_mask&= ~(LogMysqlInfo|LogMysqlWarning|LogMysqlError);
-	storageHandler->addNfsLogger(falcon_debug_mask, StorageInterface::logger, NULL);
+	int falconDebugMask = falcon_debug_mask | LogDefaultMask;
+	storageHandler->addNfsLogger(falconDebugMask, StorageInterface::logger, NULL);
 	storageHandler->addNfsLogger(LogMysqlInfo|LogMysqlWarning|LogMysqlError, StorageInterface::mysqlLogger, NULL);
 
 	if (falcon_debug_server)
@@ -3864,7 +3865,8 @@ void StorageInterface::updateDebugMask(M
 	falcon_debug_mask = *(uint*) save;
 	falcon_debug_mask&= ~(LogMysqlInfo|LogMysqlWarning|LogMysqlError);
 	storageHandler->deleteNfsLogger(StorageInterface::logger, NULL);
-	storageHandler->addNfsLogger(falcon_debug_mask, StorageInterface::logger, NULL);
+	int falconDebugMask = falcon_debug_mask | LogDefaultMask;
+	storageHandler->addNfsLogger(falconDebugMask, StorageInterface::logger, NULL);
 }
 
 int StorageInterface::recover (handlerton * hton, XID *xids, uint length)


Attachment: [text/bzr-bundle] bzr/olav.sandstaa@sun.com-20090310093511-se2myagdlo9lqo1v.bundle
Thread
bzr commit into mysql-6.0-falcon-team branch (Olav.Sandstaa:3059) Olav.Sandstaa10 Mar