org.pmw.tinylog.Logger.warn()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中org.pmw.tinylog.Logger.warn()方法的一些代码示例,展示了Logger.warn()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.warn()方法的具体详情如下:
包路径:org.pmw.tinylog.Logger
类名称:Logger
方法名:warn

Logger.warn介绍

暂无

代码示例

代码示例来源:origin: mattjlewis/diozero

@Override
public void setBoardPwmFrequency(int frequency) {
  // Ignore
  Logger.warn("Not implemented");
}

代码示例来源:origin: mattjlewis/diozero

@Override
public void setBoardPwmFrequency(int pwmFrequency) {
  // Not supported
  Logger.warn("Cannot change PWM frequency for the Piconzero");
}

代码示例来源:origin: mathisdt/trackworktime

@Override
public int w(String tag, String msg, Throwable tr) {
  Logger.warn(tr, msg);
  return Log.w(tag, msg, tr);
}
@Override

代码示例来源:origin: mathisdt/trackworktime

@Override
public int w(String tag, Throwable tr) {
  Logger.warn(tr);
  return Log.w(tag, tr);
}
@Override

代码示例来源:origin: mathisdt/trackworktime

private void tryPebbleNotification(String message) {
  try {
    externalNotificationManager.notifyPebble(message);
  } catch (Exception e) {
    Logger.warn("Pebble notification failed");
  }
}

代码示例来源:origin: mathisdt/trackworktime

@Override
  public void error(Throwable t) {
    Logger.warn("error receiving the current device location: {}", t);
    Intent messageIntent = createMessageIntent(
      "Could not get the current location. Please ensure that this app can access the coarse location.",
      null);
    reference.startActivity(messageIntent);
  }
});

代码示例来源:origin: mattjlewis/diozero

@Override
protected void closeDevice() {
  try { setEnabled(false); } catch (Exception e) { }
  try { dutyFile.close(); } catch (Exception e) { }
  Path pwm_chip_root = FileSystems.getDefault().getPath("/sys/class/pwm/pwmchip" + pwmChip);
  try (FileWriter writer = new FileWriter(pwm_chip_root.resolve("unexport").toFile())) {
    writer.write(String.valueOf(pwmNum));
  } catch (Exception e) {
    Logger.warn(e, "Error closing pwm #" + pwmNum);
  }
}

代码示例来源:origin: mattjlewis/diozero

static BoardInfo get(String hardware, String revision, Integer memoryKb) {
  Logger.warn("Failed to resolve board info for hardware '{}' and revision '{}'. Local O/S: {}",
      hardware, revision, System.getProperty("os.name"));
  return new UnknownBoardInfo();
}

代码示例来源:origin: mathisdt/trackworktime

private void tryVibration() {
  try {
    externalNotificationManager.vibrate(Constants.VIBRATION_PATTERN);
  } catch (RuntimeException re) {
    Logger.warn("vibration not allowed by permissions");
  }
}

代码示例来源:origin: mathisdt/trackworktime

private void tryPebbleNotification(String message) {
  try {
    externalNotificationManager.notifyPebble(message);
  } catch (Exception e) {
    Logger.warn("Pebble notification failed");
  }
}

代码示例来源:origin: mathisdt/trackworktime

private void tryVibration() {
  try {
    externalNotificationManager.vibrate(Constants.VIBRATION_PATTERN);
  } catch (RuntimeException re) {
    Logger.warn("vibration not allowed by permissions");
  }
}

代码示例来源:origin: openpnp/openpnp

private void search() {
  RowFilter<PackagesTableModel, Object> rf = null;
  // If current expression doesn't parse, don't update.
  try {
    rf = RowFilter.regexFilter("(?i)" + searchTextField.getText().trim());
  }
  catch (PatternSyntaxException e) {
    Logger.warn("Search failed", e);
    return;
  }
  tableSorter.setRowFilter(rf);
}

代码示例来源:origin: openpnp/openpnp

private void search() {
  RowFilter<PartsTableModel, Object> rf = null;
  // If current expression doesn't parse, don't update.
  try {
    rf = RowFilter.regexFilter("(?i)" + searchTextField.getText().trim());
  }
  catch (PatternSyntaxException e) {
    Logger.warn("Search failed", e);
    return;
  }
  tableSorter.setRowFilter(rf);
}

代码示例来源:origin: openpnp/openpnp

private void search() {
  RowFilter<FeedersTableModel, Object> rf = null;
  // If current expression doesn't parse, don't update.
  try {
    rf = RowFilter.regexFilter("(?i)" + searchTextField.getText().trim());
  }
  catch (PatternSyntaxException e) {
    Logger.warn("Search failed", e);
    return;
  }
  tableSorter.setRowFilter(rf);
}

代码示例来源:origin: mattjlewis/diozero

@Override
public float getRelativeHumidity() {
  byte status = device.readByte(STATUS_REG);
  if ((status & SR_H_DA) == 0) {
    Logger.warn("Humidity data not available");
    return -1;
  }
  
  // Read raw humidity
  short humidity_raw = device.readShort(HUMIDITY_OUT | READ);
  
  return (h1Rh - h0Rh) * (humidity_raw - h0T0Out) / (h1T0Out - h0T0Out) + h0Rh;
}

代码示例来源:origin: mattjlewis/diozero

@Override
public float getPressure() {
  byte status = device.readByte(STATUS_REG);
  if ((status & SR_P_DA) == 0) {
    Logger.warn("Pressure data not available");
    return -1;
  }
  
  byte[] raw_data = device.readBytes(PRESS_OUT_XL | READ, 3);
  
  int raw_pressure = raw_data[2] << 16 | (raw_data[1] & 0xff) << 8 | (raw_data[0] & 0xff);
  
  return (float) (raw_pressure / PRESSURE_SCALE);
}

代码示例来源:origin: mattjlewis/diozero

public LM73(int controller, Configuration config) {
  this.config = config;
  resolution = DEFAULT_RESOLUTION;
  
  device = new I2CDevice(controller, config.getAddress());
  int id = device.readUShort(ID_REG);
  if (id != LM73_ID) {
    Logger.warn("Expected device id 0x{}, got 0x{}", Integer.toHexString(LM73_ID), Integer.toHexString(id));
  }
}

代码示例来源:origin: mattjlewis/diozero

@Override
public void enableListener() {
  disableListener();
  if (edge == PigpioConstants.NO_EDGE) {
    Logger.warn("Edge was configured to be NO_EDGE, no point adding a listener");
    return;
  }
  
  int rc = pigpioImpl.enableListener(gpio, edge, this);
  if (rc < 0) {
    throw new RuntimeIOException("Error calling pigpioImpl.setISRFunc(), response: " + rc);
  }
}

代码示例来源:origin: mattjlewis/diozero

public void closed(DeviceInterface device) {
  Logger.debug("closed({})", device.getKey());
  if (devices.remove(device.getKey()) == null) {
    Logger.warn("Request to close unknown device with key '{}'", device.getKey());
  }
}

代码示例来源:origin: mattjlewis/diozero

@Override
public PwmOutputDeviceInterface createPwmOutputDevice(String key, PinInfo pinInfo, int pwmFrequency,
    float initialValue) {
  Logger.warn("Using software PWM on gpio {}", Integer.valueOf(pinInfo.getDeviceNumber()));
  SoftwarePwmOutputDevice pwm = new SoftwarePwmOutputDevice(key, this,
      createDigitalOutputDevice(createPinKey(pinInfo), pinInfo, false), pwmFrequency, initialValue);
  return pwm;
}

相关文章