18
18
*/
19
19
20
20
/*
21
- * Copyright (c) 2021, 2022 , Oracle and/or its affiliates. All rights reserved.
21
+ * Copyright (c) 2021, 2024 , Oracle and/or its affiliates. All rights reserved.
22
22
*/
23
23
package org .opengrok .indexer .history ;
24
24
40
40
import java .util .logging .Level ;
41
41
import java .util .logging .Logger ;
42
42
43
+ import static org .opengrok .indexer .web .Laundromat .launderLog ;
44
+
43
45
public class FileAnnotationCache extends AbstractCache implements AnnotationCache {
44
46
45
47
private static final Logger LOGGER = LoggerFactory .getLogger (FileAnnotationCache .class );
@@ -169,11 +171,11 @@ public Annotation get(File file, @Nullable String rev) throws CacheException {
169
171
* should be present to catch weird cases of someone not using the store() or general badness.
170
172
*/
171
173
if (storedRevision == null ) {
172
- LOGGER .log (Level .FINER , "no stored revision in annotation cache for ''{0}''" , file );
174
+ LOGGER .finer (() -> String .format ("no stored revision in annotation cache for '%s'" ,
175
+ launderLog (file .toString ())));
173
176
} else if (!storedRevision .equals (latestRevision )) {
174
- LOGGER .log (Level .FINER ,
175
- "stored revision {0} for ''{1}'' does not match latest revision {2}" ,
176
- new Object []{storedRevision , file , rev });
177
+ LOGGER .finer (() -> String .format ("stored revision %s for '%s' does not match latest revision %s" ,
178
+ storedRevision , launderLog (file .toString ()), rev ));
177
179
} else {
178
180
// read from the cache
179
181
annotation = readAnnotation (file );
@@ -188,8 +190,8 @@ public Annotation get(File file, @Nullable String rev) throws CacheException {
188
190
if (fileAnnotationCacheMisses != null ) {
189
191
fileAnnotationCacheMisses .increment ();
190
192
}
191
- LOGGER .log ( Level . FINEST , "annotation cache miss for ''{0}'' in revision {1} " ,
192
- new Object []{ file , rev } );
193
+ LOGGER .finest (() -> String . format ( "annotation cache miss for '%s' in revision %s " ,
194
+ launderLog ( file . toString ()) , rev ) );
193
195
return null ;
194
196
}
195
197
0 commit comments