本文整理汇总了Java中org.pmw.tinylog.Logger.debug方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.debug方法的具体用法?Java Logger.debug怎么用?Java Logger.debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pmw.tinylog.Logger
的用法示例。
在下文中一共展示了Logger.debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: send
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
/**
* Send datas on the socket
* @param datas Datas to send
* @throws YeelightSocketException when socket error occurs
*/
public void send(String datas) throws YeelightSocketException {
try {
Logger.debug("{} sent to {}:{}", datas, this.ip, this.port);
this.socketWriter.write(datas);
this.socketWriter.flush();
} catch (Exception e) {
throw new YeelightSocketException(e);
}
}
示例2: main
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
public static void main(String[] args) {
// source coude generate level tag
final String preLevelTag = "[[preLevelTag]]";
final String postLevelTag = "[[postLevelTag]]";
// for "1 default example" and "2 log-level decoration example" (see tinylog.properties)
Logger.trace("hello trace-world");
Logger.debug("hello debug-world");
Logger.info("hello info-world");
Logger.warn("hello warn-world");
// Logger.warn("hello warn-world with {}source code generated{} 'misuse' of the level tag", preLevelTag, postLevelTag);
Logger.error("hello error-world");
// for "3 custom tag usage example" (see tinylog.properties)
// Logger.info("Example 1 - sequential tag replacement: [[someCustomPreTag]] some text [[someCustomPostTag]] and possibly some other text");
// Logger.info("Example 2 - coloring of tag occurrence: ----- pre-init (phase 1) ----- and possibly some other text");
// Logger.info("Example 3 - coloring within a tag: <---- init (phase 2) ----> and possibly some other text");
// Logger.info("Example 4 - coloring of tagged content: <==== init DONE ====> and possibly some other text");
// Logger.info("Example 5 - coloring or arbitrary strings: UNCAUGHT EXCEPTION: error in some class");
}
示例3: ProxyServer
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
public ProxyServer(final ProxyServerConfig config) throws SocketException {
this.bindAddress = config.getBindAddress();
this.limitMbps = config.getMbpsLimit();
this.welcomeMessage = config.getWelcomeMessage();
this.allowLoopback = config.isAllowLoopback();
this.packetCryptor = config.getDragoniteSocketParameters().getPacketCryptor();
this.dragoniteServer = new DragoniteServer(bindAddress.getAddress(), bindAddress.getPort(),
ProxyGlobalConstants.INIT_SEND_SPEED, config.getDragoniteSocketParameters());
acceptThread = new Thread(() -> {
try {
DragoniteSocket socket;
while (doAccept && (socket = dragoniteServer.accept()) != null) {
Logger.debug("New client from {}", socket.getRemoteSocketAddress().toString());
handleClient(socket);
}
} catch (final InterruptedException e) {
Logger.error(e, "Unable to accept Dragonite connections");
}
}, "PS-Accept");
acceptThread.start();
}
示例4: ForwarderServer
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
public ForwarderServer(final ForwarderServerConfig config) throws SocketException {
this.bindAddress = config.getBindAddress();
this.forwardingAddress = config.getForwardingAddress();
this.limitMbps = config.getMbpsLimit();
this.welcomeMessage = config.getWelcomeMessage();
this.dragoniteServer = new DragoniteServer(bindAddress.getAddress(), bindAddress.getPort(),
ForwarderGlobalConstants.INIT_SEND_SPEED, config.getDragoniteSocketParameters());
acceptThread = new Thread(() -> {
try {
DragoniteSocket socket;
while (doAccept && (socket = dragoniteServer.accept()) != null) {
Logger.debug("New client from {}", socket.getRemoteSocketAddress().toString());
handleClient(socket);
}
} catch (final InterruptedException e) {
Logger.error(e, "Unable to accept Dragonite connections");
}
}, "FS-Accept");
acceptThread.start();
}
示例5: test
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
@Test
public void test() {
System.out.println(Type.valueOf(Type.DS1822.getId()));
System.out.println(Type.valueOf(Type.DS1822.name()));
List<W1ThermSensor> sensors = W1ThermSensor.getAvailableSensors("src/test/resources/devices");
Assert.assertEquals(5, sensors.size());
for (W1ThermSensor sensor : sensors) {
Logger.debug("Serial number=" + sensor.getSerialNumber());
Logger.debug("Type=" + sensor.getType());
Assert.assertEquals(expectedTypes.get(sensor.getSerialNumber()), sensor.getType());
Double expected_temp = expectedTemperatures.get(sensor.getSerialNumber());
if (expected_temp != null) {
Logger.debug("Temperature={}", Float.valueOf(sensor.getTemperature()));
Assert.assertEquals(expected_temp.doubleValue(), sensor.getTemperature(), 0.001);
}
}
}
示例6: PigpioJSpiDevice
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
public PigpioJSpiDevice(String key, DeviceFactoryInterface deviceFactory, PigpioInterface pigpioImpl,
int controller, int chipSelect, int frequency, SpiClockMode spiClockMode, boolean lsbFirst)
throws RuntimeIOException {
super(key, deviceFactory);
this.pigpioImpl = pigpioImpl;
this.controller = controller;
this.chipSelect = chipSelect;
int flags = createSpiFlags(spiClockMode, controller, lsbFirst);
int rc = pigpioImpl.spiOpen(chipSelect, frequency, flags);
if (rc < 0) {
handle = CLOSED;
throw new RuntimeIOException(String.format("Error opening SPI device on controller %d, chip-select %d, response: %d",
Integer.valueOf(controller), Integer.valueOf(chipSelect), Integer.valueOf(rc)));
}
handle = rc;
Logger.debug("SPI device ({}-{}) opened, handle={}", Integer.valueOf(controller),
Integer.valueOf(chipSelect), Integer.valueOf(handle));
}
示例7: readLine
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
/**
* Read line on the socket (terminated with \r, \n or \r\n)
* @return The line read
* @throws YeelightSocketException when socket error occurs
*/
public String readLine() throws YeelightSocketException {
try {
String datas = this.socketReader.readLine();
Logger.debug("{} received from {}:{}", datas, this.ip, this.port);
return datas;
} catch (Exception e) {
throw new YeelightSocketException(e);
}
}
示例8: closeDevice
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
@Override
protected void closeDevice() throws RuntimeIOException {
Logger.debug("closeDevice()");
disableListener();
if (sysFsDigitialInput != null) {
sysFsDigitialInput.close();
sysFsDigitialInput = null;
}
}
示例9: getPwm
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
private int[] getPwm(int channel) throws RuntimeIOException {
validateChannel(channel);
short on_l = i2cDevice.readUByte(LED0_ON_L + 4*channel);
short on_h = i2cDevice.readUByte(LED0_ON_H + 4*channel);
int on = (on_h << 8) | on_l;
short off_l = i2cDevice.readUByte(LED0_OFF_L + 4*channel);
short off_h = i2cDevice.readUByte(LED0_OFF_H + 4*channel);
int off = (off_h << 8) | off_l;
Logger.debug("channel={}, on={}, off={}", Integer.valueOf(channel), Integer.valueOf(on), Integer.valueOf(off));
return new int[] { on, off };
}
示例10: closeDevice
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
@Override
protected void closeDevice() throws RuntimeIOException {
Logger.debug("closeDevice()");
removeListener();
if (pin.isOpen()) {
try {
pin.close();
} catch (IOException e) {
throw new RuntimeIOException(e);
}
}
}
示例11: closeDevice
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
@Override
protected void closeDevice() throws RuntimeIOException {
Logger.debug("closeDevice()");
// Revert to input mode?
BbbIoLibNative.setDir(BbbIoLibDeviceFactory.getPort(pinInfo), (byte) pinInfo.getPinNumber(),
BbbIoLibNative.BBBIO_DIR_IN);
}
示例12: readByte
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
@Override
public byte readByte() {
Logger.debug("read()");
byte data;
try {
ByteBuffer buffer = ByteBuffer.allocateDirect(1);
i2cDevice.ask(NO_REGISTER, (byte) 1, this);
waitForData(NO_REGISTER, buffer);
data = buffer.get(0);
} catch (IOException e) {
throw new RuntimeIOException(e);
}
return data;
}
示例13: close
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
/**
* Free device GPIOs
*/
@Override
public void close() {
Logger.debug("close()");
if (trigger != null) { trigger.close(); }
if (echo != null) { echo.close(); }
}
示例14: authenticate
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
/**
* Executes the MFRC522 MFAuthent command.
* This command manages MIFARE authentication to enable a secure communication to any MIFARE Mini, MIFARE 1K and MIFARE 4K card.
* The authentication is described in the MFRC522 datasheet section 10.3.1.9 and http://www.nxp.com/documents/data_sheet/MF1S503x.pdf section 10.1.
* For use with MIFARE Classic PICCs.
* The PICC must be selected - ie in state ACTIVE(*) - before calling this function.
* Remember to call PCD_StopCrypto1() after communicating with the authenticated PICC - otherwise no new communications can start.
*
* All keys are set to FFFFFFFFFFFFh at chip delivery.
*
* @param authKeyA PICC_CMD_MF_AUTH_KEY_A or PICC_CMD_MF_AUTH_KEY_B
* @param blockAddr The block number. See numbering in the comments in the .h file.
* @param key Crypto1 key to use (6 bytes)
* @param uid Pointer to Uid struct. The first 4 bytes of the UID is used.
* @return STATUS_OK on success, STATUS_??? otherwise. Probably STATUS_TIMEOUT if you supply the wrong key.
*/
public StatusCode authenticate(boolean authKeyA, byte blockAddr, byte[] key, UID uid) {
Logger.debug("blockAddr: " + blockAddr);
// Build command buffer
byte[] sendData = new byte[12];
sendData[0] = authKeyA ? PiccCommand.MF_AUTH_KEY_A.getValue() : PiccCommand.MF_AUTH_KEY_B.getValue();
sendData[1] = blockAddr;
System.arraycopy(key, 0, sendData, 2, key.length);
/*
for (byte i=0; i<key.length; i++) { // 6 key bytes
sendData[2+i] = key[i];
}
*/
// Use the last uid bytes as specified in http://cache.nxp.com/documents/application_note/AN10927.pdf
// section 3.2.5 "MIFARE Classic Authentication".
// The only missed case is the MF1Sxxxx shortcut activation,
// but it requires cascade tag (CT) byte, that is not part of uid.
System.arraycopy(uid.getUidBytes(), uid.getUidBytes().length-4, sendData, 8, 4);
/*
for (byte i=0; i<4; i++) { // The last 4 bytes of the UID
sendData[8+i] = uid.getUidByte(i + uid.getSize() - 4);
}
*/
byte waitIRq = 0x10; // IdleIRq
// Start the authentication.
return communicateWithPICC(PcdCommand.MF_AUTHENT, waitIRq, sendData).getStatus();
//return PCD_CommunicateWithPICC(PCD_MFAuthent, waitIRq, &sendData[0], sizeof(sendData));
}
示例15: MqttTestApp
import org.pmw.tinylog.Logger; //导入方法依赖的package包/类
public MqttTestApp() throws UnknownHostException, MqttException {
mqttClient = new MqttClient(mqttUrl, CLIENT_ID_PREFIX + InetAddress.getLocalHost().getHostName(),
new MemoryPersistence());
mqttClient.setCallback(this);
MqttConnectOptions con_opts = new MqttConnectOptions();
con_opts.setAutomaticReconnect(true);
con_opts.setCleanSession(true);
Logger.debug("Connecting to {}...", mqttUrl);
mqttClient.connect(con_opts);
Logger.debug("Connected to {}", mqttUrl);
mqttClient.subscribe("outTopic");
mqttClient.subscribe(MqttProviderConstants.RESPONSE_TOPIC);
}