diff options
Diffstat (limited to 'lib/backupstore')
-rw-r--r-- | lib/backupstore/BackupStoreCheck.cpp | 3 | ||||
-rw-r--r-- | lib/backupstore/BackupStoreCheck2.cpp | 35 | ||||
-rw-r--r-- | lib/backupstore/BackupStoreCheckData.cpp | 13 | ||||
-rw-r--r-- | lib/backupstore/BackupStoreConfigVerify.cpp | 17 |
4 files changed, 21 insertions, 47 deletions
diff --git a/lib/backupstore/BackupStoreCheck.cpp b/lib/backupstore/BackupStoreCheck.cpp index 7598094e..176ece8f 100644 --- a/lib/backupstore/BackupStoreCheck.cpp +++ b/lib/backupstore/BackupStoreCheck.cpp @@ -268,8 +268,7 @@ void BackupStoreCheck::CheckObjects() } maxDir = CheckObjectsScanDir(0, 1, mStoreRoot); - BOX_TRACE("Max dir starting ID is " << - BOX_FORMAT_OBJECTID(maxDir)); + TRACE1("Max dir starting ID is %llx\n", maxDir); } // Then go through and scan all the objects within those directories diff --git a/lib/backupstore/BackupStoreCheck2.cpp b/lib/backupstore/BackupStoreCheck2.cpp index 40d34a5b..9c6f2452 100644 --- a/lib/backupstore/BackupStoreCheck2.cpp +++ b/lib/backupstore/BackupStoreCheck2.cpp @@ -594,8 +594,6 @@ void BackupStoreCheck::WriteNewStoreInfo() } } -#define FMT_OID(x) BOX_FORMAT_OBJECTID(x) -#define FMT_i BOX_FORMAT_OBJECTID((*i)->GetObjectID()) // -------------------------------------------------------------------------- // @@ -622,11 +620,7 @@ bool BackupStoreDirectory::CheckAndFix() if(newerEn == 0) { // Depends on something, but it isn't there. - BOX_TRACE("Entry id " << FMT_i << - " removed because depends " - "on newer version " << - FMT_OID(dependsNewer) << - " which doesn't exist"); + TRACE2("Entry id %llx removed because depends on newer version %llx which doesn't exist\n", (*i)->GetObjectID(), dependsNewer); // Remove delete *i; @@ -644,12 +638,7 @@ bool BackupStoreDirectory::CheckAndFix() if(newerEn->GetDependsOlder() != (*i)->GetObjectID()) { // Wrong entry - BOX_TRACE("Entry id " << - FMT_OID(dependsNewer) << - ", correcting DependsOlder to " << - FMT_i << - ", was " << - FMT_OID(newerEn->GetDependsOlder())); + TRACE3("Entry id %llx, correcting DependsOlder to %llx, was %llx\n", dependsNewer, (*i)->GetObjectID(), newerEn->GetDependsOlder()); newerEn->SetDependsOlder((*i)->GetObjectID()); // Mark as changed changed = true; @@ -668,11 +657,7 @@ bool BackupStoreDirectory::CheckAndFix() if(dependsOlder != 0 && FindEntryByID(dependsOlder) == 0) { // Has an older version marked, but this doesn't exist. Remove this mark - BOX_TRACE("Entry id " << FMT_i << - " was marked as depended on by " << - FMT_OID(dependsOlder) << ", " - "which doesn't exist, dependency " - "info cleared"); + TRACE2("Entry id %llx was marked that %llx depended on it, which doesn't exist, dependency info cleared\n", (*i)->GetObjectID(), dependsOlder); (*i)->SetDependsOlder(0); @@ -708,7 +693,7 @@ bool BackupStoreDirectory::CheckAndFix() bool removeEntry = false; if((*i) == 0) { - BOX_TRACE("Remove because null pointer found"); + TRACE0("Remove because null pointer found\n"); removeEntry = true; } else @@ -719,8 +704,7 @@ bool BackupStoreDirectory::CheckAndFix() if(isDir && (((*i)->GetFlags() & Entry::Flags_File) == Entry::Flags_File)) { // Bad! Unset the file flag - BOX_TRACE("Entry " << FMT_i << - ": File flag and dir flag both set"); + TRACE1("Entry %llx: File flag set when dir flag set\n", (*i)->GetObjectID()); (*i)->RemoveFlags(Entry::Flags_File); changed = true; } @@ -729,8 +713,7 @@ bool BackupStoreDirectory::CheckAndFix() if(idsEncountered.find((*i)->GetObjectID()) != idsEncountered.end()) { // ID already seen, or type doesn't match - BOX_TRACE("Entry " << FMT_i << - ": Remove because ID already seen"); + TRACE1("Entry %llx: Remove because ID already seen\n", (*i)->GetObjectID()); removeEntry = true; } else @@ -747,8 +730,7 @@ bool BackupStoreDirectory::CheckAndFix() && ((*i)->GetFlags() & Entry::Flags_Deleted) == 0) { // Not set, set it - BOX_TRACE("Entry " << FMT_i << - ": Set old flag"); + TRACE1("Entry %llx: Set old flag\n", (*i)->GetObjectID()); (*i)->AddFlags(Entry::Flags_OldVersion); changed = true; } @@ -759,8 +741,7 @@ bool BackupStoreDirectory::CheckAndFix() if(((*i)->GetFlags() & Entry::Flags_OldVersion) == Entry::Flags_OldVersion) { // Set, unset it - BOX_TRACE("Entry " << FMT_i << - ": Old flag unset"); + TRACE1("Entry %llx: Old flag unset\n", (*i)->GetObjectID()); (*i)->RemoveFlags(Entry::Flags_OldVersion); changed = true; } diff --git a/lib/backupstore/BackupStoreCheckData.cpp b/lib/backupstore/BackupStoreCheckData.cpp index aeb96173..f22c8339 100644 --- a/lib/backupstore/BackupStoreCheckData.cpp +++ b/lib/backupstore/BackupStoreCheckData.cpp @@ -189,18 +189,15 @@ void BackupStoreCheck::DumpObjectInfo() { IDBlock *pblock = i->second; int32_t bentries = (pblock == mpInfoLastBlock)?mInfoLastBlockEntries:BACKUPSTORECHECK_BLOCK_SIZE; - BOX_TRACE("BLOCK @ " << BOX_FORMAT_HEX32(pblock) << - ", " << bentries << " entries"); + TRACE2("BLOCK @ 0x%08x, %d entries\n", pblock, bentries); for(int e = 0; e < bentries; ++e) { uint8_t flags = GetFlags(pblock, e); - BOX_TRACE(std::hex << - "id " << pblock->mID[e] << - ", c " << pblock->mContainer[e] << - ", " << ((flags & Flags_IsDir)?"dir":"file") << - ", " << ((flags & Flags_IsContained) ? - "contained":"unattached")); + TRACE4("id %llx, c %llx, %s, %s\n", + pblock->mID[e], pblock->mContainer[e], + (flags & Flags_IsDir)?"dir":"file", + (flags & Flags_IsContained)?"contained":"unattached"); } } } diff --git a/lib/backupstore/BackupStoreConfigVerify.cpp b/lib/backupstore/BackupStoreConfigVerify.cpp index cc6efcf5..784adfb8 100644 --- a/lib/backupstore/BackupStoreConfigVerify.cpp +++ b/lib/backupstore/BackupStoreConfigVerify.cpp @@ -16,8 +16,7 @@ static const ConfigurationVerifyKey verifyserverkeys[] = { - SERVERTLS_VERIFY_SERVER_KEYS(ConfigurationVerifyKey::NoDefaultValue) - // no default listen addresses + SERVERTLS_VERIFY_SERVER_KEYS(0) // no default listen addresses }; static const ConfigurationVerify verifyserver[] = @@ -33,18 +32,16 @@ static const ConfigurationVerify verifyserver[] = static const ConfigurationVerifyKey verifyrootkeys[] = { - ConfigurationVerifyKey("AccountDatabase", ConfigTest_Exists), - ConfigurationVerifyKey("TimeBetweenHousekeeping", - ConfigTest_Exists | ConfigTest_IsInt), - ConfigurationVerifyKey("ExtendedLogging", ConfigTest_IsBool, false), - // make value "yes" to enable in config file + {"AccountDatabase", 0, ConfigTest_Exists, 0}, + {"TimeBetweenHousekeeping", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, + {"ExtendedLogging", "no", ConfigTest_IsBool, 0}, // make value "yes" to enable in config file #ifdef WIN32 - ConfigurationVerifyKey("RaidFileConf", ConfigTest_LastEntry) + {"RaidFileConf", "", ConfigTest_LastEntry, 0} #else - ConfigurationVerifyKey("RaidFileConf", ConfigTest_LastEntry, - BOX_FILE_RAIDFILE_DEFAULT_CONFIG) + {"RaidFileConf", BOX_FILE_RAIDFILE_DEFAULT_CONFIG, ConfigTest_LastEntry, 0} #endif + }; const ConfigurationVerify BackupConfigFileVerify = |