blob: 7617dd5eb1eb6955b7b6af7e7a5696648ef47fcd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.docprocs.indexing;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* @author Simon Thoresen Hult
*/
class FastLogger {
private final Logger log;
private FastLogger(Logger log) {
this.log = log;
}
public void log(Level level, String format, Object... args) {
if (!log.isLoggable(level)) {
return;
}
if (args.length > 0) {
log.log(level, String.format(format, args));
} else {
log.log(level, format);
}
}
public static FastLogger getLogger(String name) {
return new FastLogger(Logger.getLogger(name));
}
}
|