blob: ba1d5e17a78028ebb68480e123be46c455f4b678 (
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 2017 Yahoo Holdings. 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));
}
}
|