search: fix panic when requesting language stats
Created by: chwarwick
Conversion from log15 missed a case where the language stats were retrieved from cache causing the logger to be nil.
resolves https://github.com/sourcegraph/sourcegraph/issues/41511
Test plan
Ran lang stats query multiple times from the api console to ensure I hit the cache and confirmed it no long caused a panic.
query LangStatsInsightContent($query: String!) {
search(query: $query) {
results {
limitHit
}
stats {
languages {
name
totalLines
}
}
}
}