@@ -254,15 +254,19 @@ private History getHistoryFromCache(File file, Repository repository, boolean wi
254
254
/**
255
255
* @param file file to get the history entry for
256
256
* @param ui is the request coming from the UI
257
- * @return last (newest) history entry for given file or null
257
+ * @return last (newest) history entry for given file or {@code null}
258
258
* @throws HistoryException if history retrieval failed
259
259
*/
260
260
@ Nullable
261
261
public HistoryEntry getLastHistoryEntry (File file , boolean ui ) throws HistoryException {
262
+ Statistics statistics = new Statistics ();
263
+ LOGGER .log (Level .FINEST , "started retrieval of last history entry for ''{0}''" , file );
262
264
final File dir = file .isDirectory () ? file : file .getParentFile ();
263
265
final Repository repository = getRepository (dir );
264
266
265
267
if (!isRepoHistoryEligible (repository , file , ui )) {
268
+ LOGGER .log (Level .FINER , "cannot retrieve the last history entry for ''{0}'' in {1} because of settings" ,
269
+ new Object []{file , repository });
266
270
return null ;
267
271
}
268
272
@@ -282,7 +286,15 @@ public HistoryEntry getLastHistoryEntry(File file, boolean ui) throws HistoryExc
282
286
return null ;
283
287
}
284
288
285
- return repository .getLastHistoryEntry (file , ui );
289
+ HistoryEntry lastHistoryEntry = repository .getLastHistoryEntry (file , ui );
290
+ if (lastHistoryEntry != null ) {
291
+ LOGGER .log (Level .FINEST , "got latest history entry {0} for ''{1}'' using repository {2}" ,
292
+ new Object []{lastHistoryEntry , file , repository });
293
+ }
294
+ statistics .report (LOGGER , Level .FINEST ,
295
+ String .format ("finished retrieval of last history entry for '%s' (%s)" ,
296
+ file , lastHistoryEntry != null ? "success" : "fail" ), "history.lasthistoryentry" );
297
+ return lastHistoryEntry ;
286
298
}
287
299
288
300
public History getHistory (File file , boolean withFiles , boolean ui ) throws HistoryException {
0 commit comments