index: ignore recpn log spam, export SetVerboseCorpusLogging for pkg/search tests

Change-Id: Ie18c8db5ab33e94a6c37e3fa19170ac046d864b2
This commit is contained in:
Brad Fitzpatrick 2013-12-09 11:26:33 +04:00
parent 06011342a0
commit 2f9b87ad59
3 changed files with 9 additions and 4 deletions

View File

@ -130,6 +130,7 @@ func (crashStorage) Find(start, end string) sorted.Iterator {
var corpusMergeFunc = map[string]func(c *Corpus, k, v []byte) error{
"have": nil, // redundant with "meta"
"recpn": nil, // unneeded.
"meta": (*Corpus).mergeMetaRow,
"signerkeyid": (*Corpus).mergeSignerKeyIdRow,
"claim": (*Corpus).mergeClaimRow,
@ -686,3 +687,9 @@ func (c *Corpus) GetImageInfo(fileRef blob.Ref) (ii camtypes.ImageInfo, err erro
}
return
}
// SetVerboseCorpusLogging controls corpus setup verbosity. It's on by default
// but used to disable verbose logging in tests.
func SetVerboseCorpusLogging(v bool) {
logCorpusStats = v
}

View File

@ -46,8 +46,8 @@ func BenchmarkCorpusFromStorage(b *testing.B) {
id.SetAttribute(pn, "camliContent", fileRef.String())
}
})
defer index.ExpSetLogCorpusStats(true)
index.ExpSetLogCorpusStats(false)
defer index.SetVerboseCorpusLogging(true)
index.SetVerboseCorpusLogging(false)
b.ResetTimer()

View File

@ -29,8 +29,6 @@ func ExpUnreverseTimeString(s string) string {
return unreverseTimeString(s)
}
func ExpSetLogCorpusStats(v bool) { logCorpusStats = v }
func ExpNewCorpus() *Corpus {
return newCorpus()
}