List:Commits« Previous MessageNext Message »
From:Olav.Sandstaa Date:June 23 2009 1:20pm
Subject:bzr commit into mysql-6.0-falcon-team branch (Olav.Sandstaa:2740)
View as plain text  
#At file:///home/olav/mysql/develop/falcon-elog/ based on revid:olav@stripped

 2740 Olav.Sandstaa@stripped	2009-06-23
      Extend Falcon's Log class with the following:
            
      1. A new debug mask called LogAlwaysWrite:
            
         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-06-23 13:20:36 +0000
@@ -119,6 +119,16 @@ void Log::debug(const char *txt, ...)
 	log (LogDebug, txt, args);
 }
 
+void Log::fatal(const char *txt, ...)
+{
+	if (!(activeMask & LogAlwaysWrite))
+		return;
+
+	va_list		args;
+	va_start	(args, txt);
+	log (LogAlwaysWrite, 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-06-23 13:20:36 +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	LogAlwaysWrite   = 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   = LogAlwaysWrite;
+
 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-05-20 10:41:39 +0000
+++ b/storage/falcon/ha_falcon.cpp	2009-06-23 13:20:36 +0000
@@ -252,7 +252,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)
@@ -3924,7 +3925,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-20090623132036-dhkrfv3o87fq3841.bundle
Thread
bzr commit into mysql-6.0-falcon-team branch (Olav.Sandstaa:2740) Olav.Sandstaa23 Jun