Loggin improvement in the PRi sensor
Former-commit-id: 190bc7c849549b13f1abc8058bbae726883d65d6
This commit is contained in:
parent
bd14a79be7
commit
656bc41226
1 changed files with 9 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import com.pi4j.io.gpio.*;
|
||||||
import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
|
import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
|
||||||
import com.pi4j.io.gpio.event.GpioPinListenerDigital;
|
import com.pi4j.io.gpio.event.GpioPinListenerDigital;
|
||||||
import zutil.db.DBConnection;
|
import zutil.db.DBConnection;
|
||||||
|
import zutil.log.CompactLogFormatter;
|
||||||
import zutil.log.LogUtil;
|
import zutil.log.LogUtil;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
@ -33,6 +34,14 @@ public class RPiImpulseCountSensor implements Runnable {
|
||||||
*/
|
*/
|
||||||
public RPiImpulseCountSensor(int sensorId, Pin pin) throws Exception{
|
public RPiImpulseCountSensor(int sensorId, Pin pin) throws Exception{
|
||||||
|
|
||||||
|
// init logging
|
||||||
|
CompactLogFormatter formatter = new CompactLogFormatter();
|
||||||
|
LogUtil.setLevel("se.hal", Level.FINEST);
|
||||||
|
LogUtil.setFormatter("se.hal", formatter);
|
||||||
|
LogUtil.setLevel("zutil", Level.FINEST);
|
||||||
|
LogUtil.setFormatter("zutil", formatter);
|
||||||
|
LogUtil.setGlobalFormatter(formatter);
|
||||||
|
|
||||||
this.sensorId = sensorId;
|
this.sensorId = sensorId;
|
||||||
|
|
||||||
// create gpio controller
|
// create gpio controller
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue