From 35196ce18cc2d930c4a49ef17ad2fe2e57e740fe Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Fri, 23 Nov 2012 22:35:06 +0100 Subject: [PATCH] Add more debug output to NavDataCache showing exactly which file triggers a cache rebuild. --- src/Navaids/NavDataCache.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Navaids/NavDataCache.cxx b/src/Navaids/NavDataCache.cxx index e7d885ef0..3c44fc95c 100644 --- a/src/Navaids/NavDataCache.cxx +++ b/src/Navaids/NavDataCache.cxx @@ -1096,11 +1096,11 @@ bool NavDataCache::isRebuildRequired() isCachedFileModified(d->fixDatPath) || isCachedFileModified(d->airwayDatPath)) { - SG_LOG(SG_NAVCACHE, SG_INFO, "NavCache: rebuild required"); + SG_LOG(SG_NAVCACHE, SG_INFO, "NavCache: main cache rebuild required"); return true; } - SG_LOG(SG_NAVCACHE, SG_INFO, "NavCache: no rebuild required"); + SG_LOG(SG_NAVCACHE, SG_INFO, "NavCache: no main cache rebuild required"); return false; } @@ -1267,8 +1267,18 @@ bool NavDataCache::isCachedFileModified(const SGPath& path) const sqlite_bind_temp_stdstring(d->statCacheCheck, 1, path.str()); if (d->execSelect(d->statCacheCheck)) { time_t modtime = sqlite3_column_int64(d->statCacheCheck, 0); + bool modified = (modtime != path.modTime()); + if (modified) + { + SG_LOG(SG_NAVCACHE, SG_DEBUG, "NavCache: rebuild required for " << path << ". Timestamps: " << modtime << " != " << path.modTime()); + } + else + { + SG_LOG(SG_NAVCACHE, SG_DEBUG, "NavCache: no rebuild required for " << path); + } return (modtime != path.modTime()); } else { + SG_LOG(SG_NAVCACHE, SG_DEBUG, "NavCache: initial build required for " << path); return true; } }