diff --git a/lladd/constants.h b/lladd/constants.h index 846d5ea..6cc40f7 100644 --- a/lladd/constants.h +++ b/lladd/constants.h @@ -94,6 +94,10 @@ terms specified in this license. #define BUFFER_MANAGER_REOPEN 0 #define BUFFER_MANAGER_HASH 1 #define BUFFER_MANAGER_MEM_ARRAY 2 + +#define LOG_TO_FILE 0 +#define LOG_TO_MEMORY 1 + #define MAX_TRANSACTIONS 1000 /** Operation types */ diff --git a/lladd/logger/logger2.h b/lladd/logger/logger2.h index 8a7798a..d3b6756 100644 --- a/lladd/logger/logger2.h +++ b/lladd/logger/logger2.h @@ -83,9 +83,20 @@ typedef struct { lsn_t recLSN; } TransactionLog; -#define LOG_TO_FILE 0 -#define LOG_TO_MEMORY 1 +/** + This is the log implementation that is being used. + Before Stasis is intialized, it will be set to a default value. + + It may be changed before Tinit() is called by assigning to it. + The default can be overriddent at compile time by defining + USE_LOGGER + + (eg: gcc ... -DUSE_LOGGER=LOG_TO_FOO) + + @see constants.h for a list of recognized log implementations. + + */ extern int loggerType; int LogInit(int logType); diff --git a/src/lladd/logger/logger2.c b/src/lladd/logger/logger2.c index 2091503..39a634a 100644 --- a/src/lladd/logger/logger2.c +++ b/src/lladd/logger/logger2.c @@ -59,7 +59,11 @@ terms specified in this license. #include "page.h" +#ifdef USE_LOGGER +int loggerType = USE_LOGGER; +#else int loggerType = LOG_TO_FILE; +#endif extern int numActiveXactions; static int pendingCommits;