Jdk14LogHandler.java
Go to the documentation of this file.
1 
25 package org.openkinect.freenect.util;
26 
30 
31 import java.util.EnumMap;
32 import java.util.logging.Level;
33 import java.util.logging.Logger;
34 
35 public class Jdk14LogHandler implements LogHandler {
36 
37  private final Logger logger = Logger.getLogger("freenect");
38  private final EnumMap<LogLevel, Level> levelMap = new EnumMap<LogLevel, Level>(LogLevel.class);
39 
40  public Jdk14LogHandler() {
41  logger.setLevel(Level.ALL);
42  levelMap.put(LogLevel.FATAL, Level.SEVERE);
43  levelMap.put(LogLevel.ERROR, Level.SEVERE);
44  levelMap.put(LogLevel.WARNING, Level.WARNING);
45  levelMap.put(LogLevel.NOTICE, Level.CONFIG);
46  levelMap.put(LogLevel.INFO, Level.INFO);
47  levelMap.put(LogLevel.DEBUG, Level.FINE);
48  levelMap.put(LogLevel.SPEW, Level.FINER);
49  levelMap.put(LogLevel.FLOOD, Level.FINEST);
50  }
51 
52  @Override
53  public void onMessage(Device dev, LogLevel level, String msg) {
54  logger.log(levelMap.get(level), "device " + dev.getDeviceIndex() + ": " + msg);
55  }
56 }
final EnumMap< LogLevel, Level > levelMap
void onMessage(Device dev, LogLevel level, String msg)


libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Mon Jun 10 2019 13:46:42