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

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

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

Logger.trace介绍

暂无

代码示例

代码示例来源:origin: com.xiaoleilu/hutool-log

@Override
public void trace(String format, Object... arguments) {
  Logger.trace(format, arguments);
}

代码示例来源:origin: com.xiaoleilu/hutool-log

@Override
public void trace(Throwable t, String format, Object... arguments) {
  Logger.trace(t, format, arguments);
}

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

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

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

@Override
public int v(String tag, String msg) {
  Logger.trace(msg);
  return Log.v(tag, msg);
}
@Override

代码示例来源:origin: zhicwu/cassandra-jdbc-driver

public CassandraColumnDefinition getColumnDefinition(int column)
    throws SQLException {
  if (column > 0 && column <= columnDefinitions.size()) {
    return columnDefinitions.get(column - 1);
  }
  Logger.trace("Columns for your reference: " + columnNameIndices);
  throw new SQLException("Column " + column + " does not exists!");
}

代码示例来源:origin: zhicwu/cassandra-jdbc-driver

public CassandraColumnDefinition getColumnDefinition(String columnName)
    throws SQLException {
  int column = columnNameIndices.containsKey(columnName) ? columnNameIndices
      .get(columnName) : -1;
  if (column >= 0 && column < columnDefinitions.size()) {
    return columnDefinitions.get(column);
  }
  Logger.trace("Columns for your reference: " + columnNameIndices);
  throw new SQLException("Column " + columnName + " does not exists!");
}

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

private static int checkCSV(String str[], String val[]) {
  for (int i = 0; i < str.length; i++) {
    for (int j = 0; j < val.length; j++) {
      if (str[i].equals(val[j])) {
        Logger.trace("checkCSV: " + val[j] + " = " + j);
        // check for mil units
        // TODO This should be done better, but at moment I don't know a better way...
        // -trampas
        if (val[j].equals("Ref-X(mil)")) {
          units_mils_x = 1;
          Logger.trace("X units are in mils");
        }
        if (val[j].equals("Ref-Y(mil)")) {
          units_mils_y = 1;
          Logger.trace("Y units are in mils");
        }
        if (val[j].equals("Height(mil)")) {
          units_mils_height = 1;
          Logger.trace("Height units are in mils");
        }
        return j;
      }
    }
  }
  return -1;
}

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

public void on(String event, Map<String, Object> globals) throws Exception {
    Logger.trace("Scripting.on " + event);
    for (File script : FileUtils.listFiles(eventsDirectory, extensions, false)) {
      if (!script.isFile()) {
        continue;
      }
      if (FilenameUtils.getBaseName(script.getName()).equals(event)) {
        Logger.trace("Scripting.on found " + script.getName());
        execute(script, globals);
      }
    }
  }
}

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

byte[] readWithChecksum(int length) throws Exception {
  byte[] b = new byte[length];
  for (int i = 0; i < length; i++) {
    b[i] = (byte) (read(false) & 0xff);
  }
  int checksum = read(false);
  // TODO STOPSHIP verify checksum
  StringBuffer sb = new StringBuffer();
  for (int i = 0; i < b.length; i++) {
    sb.append(String.format("%02x", b[i] & 0xff));
  }
  sb.append(String.format("%02x", checksum & 0xff));
  Logger.trace("< " + sb.toString());
  return b;
}

代码示例来源:origin: zhicwu/cassandra-jdbc-driver

@SuppressWarnings("unchecked")
@Override
protected <T> T getValue(int columnIndex, Class<T> clazz)
    throws SQLException {
  Logger.trace("Trying to get value with inputs: line={}, column={}, type={}", getRow(), columnIndex, clazz);
  Object obj = currentRow[columnIndex - 1];
  T result = null;
  Logger.trace("Got raw value [{}] from line {} of {}", obj, getRow(), data.length);
  wasNull = obj == null;
  result = this.getDataTypeConverters().convert(obj, clazz, false);
  Logger.trace("Return value: raw={}, converted={}", obj, result);
  return result;
}

代码示例来源:origin: zhicwu/cassandra-jdbc-driver

/**
 * This creates a result set based on given data and column definitions.
 *
 * @param columns column definitions, name and its Cql type
 * @param data    rows
 */
public DummyCassandraResultSet(String[][] columns, Object[][] data) {
  super(null, null);
  Logger.trace("Constructing dummy result set @{}...", hashCode());
  if (columns != null && columns.length > 0 && columns[0].length > 1) {
    for (String[] column : columns) {
      Logger.trace("* Column: {name={}, cqlType={}}", column[0], column[1]);
      metadata.addColumnDefinition(new CassandraColumnDefinition(
          null, null, column[0], column[1], false));
    }
  }
  this.data = data == null ? new String[0][] : data;
  if (LOG_LEVEL.compareTo(Level.TRACE) >= 0) {
    for (Object[] row : this.data) {
      Logger.trace("* Row: {}", Arrays.toString(row));
    }
  }
  Logger.trace("Dummy result set @{} is ready for use", hashCode());
}

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

void write(int d, boolean log) throws Exception {
  d = d & 0xff;
  if (log) {
    Logger.trace(String.format("> %02x", d));
  }
  getCommunications().write(d);
}

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

int read(boolean log) throws Exception {
  while (true) {
    try {
      int d = getCommunications().read();
      if (log) {
        Logger.trace(String.format("< %02x", d & 0xff));
      }
      return d;
    }
    catch (TimeoutException e) {
      continue;
    }
  }
}

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

void writeWithChecksum(byte[] b) throws Exception {
  StringBuffer sb = new StringBuffer();
  for (int i = 0; i < b.length; i++) {
    sb.append(String.format("%02x", b[i] & 0xff));
  }
  sb.append(String.format("%02x", checksum(b) & 0xff));
  Logger.trace("> " + sb.toString());
  for (int i = 0; i < b.length; i++) {
    write(b[i], false);
  }
  getCommunications().write(checksum(b) & 0xff);
}

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

/**
 * Wraps internalCapture() to ensure that a null image is never returned. Attempts to
 * retry capture if the capture returns null and if no image can be captured returns a
 * default image. Several of the low level camera drivers return null when there is a
 * capture error, but these are often temporary and we would prefer not to have bad
 * images returned. The retry is intended to smooth this out.
 * @return
 */
protected synchronized BufferedImage safeInternalCapture() {
  for (int i = 0; i < CAPTURE_RETRY_COUNT; i++) {
    BufferedImage image = internalCapture();
    if (image != null) {
      return image;
    }
    Logger.trace("Camera {} failed to return an image. Retrying.", this);
  }
  if (CAPTURE_ERROR_IMAGE == null) {
    CAPTURE_ERROR_IMAGE = new BufferedImage(640, 480, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g = (Graphics2D) CAPTURE_ERROR_IMAGE.createGraphics();
    g.setColor(Color.black);
    g.fillRect(0, 0, 640, 480);
    g.setColor(Color.red);
    g.drawLine(0, 0, 640, 480);
    g.drawLine(640, 0, 0, 480);
    g.dispose();
  }
  Logger.warn("Camera {} failed to return an image after {} tries.", this, CAPTURE_RETRY_COUNT);
  return CAPTURE_ERROR_IMAGE;
}

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

public void send(Message message) throws Exception {
  while (message != null) {
    State state = getState();
    Map<Message, Transition> transitions = this.transitions.get(state);
    if (transitions == null) {
      throw new Exception("No defined transitions from " + state);
    }
    Transition transition = transitions.get(message);
    if (transition == null) {
      throw new Exception("No defined transitions from " + state + " for " + message);
    }
    if (transition.task != null) {
      transition.task.task();
    }
    setState(transition.toState);
    Logger.trace(message + " => " + state + " -> " + transition.toState);
    message = transition.nextMessage;
  }
}

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

public void run() {
  while (!disconnectRequested) {
    String line;
    try {
      line = getCommunications().readLine().trim();
    }
    catch (TimeoutException ex) {
      continue;
    }
    catch (IOException e) {
      Logger.error("Read error", e);
      return;
    }
    line = line.trim();
    Logger.trace("[{}] << {}", getCommunications().getConnectionName(), line);
    if (!processPositionReport(line)) {
      responseQueue.offer(line);
    }
  }
}

代码示例来源:origin: zhicwu/cassandra-jdbc-driver

@SuppressWarnings("unchecked")
@Override
protected <T> T getValue(int columnIndex, Class<T> clazz)
    throws SQLException {
  Logger.trace("Trying to get value with inputs: line={}, column={}, type={}", getRow(), columnIndex, clazz);
  Object rawValue = null;
  T result = null;
  if (_currentRow != null) {
    String typeName = metadata.getColumnTypeName(columnIndex);
    if (clazz == String.class
        && (CassandraDataType.TIME.getTypeName().equals(typeName)
        || CassandraDataType.TIMESTAMP.getTypeName().equals(typeName))) {
      rawValue = _currentRow.getString(columnIndex - 1);
    } else {
      rawValue = _currentRow.getObject(columnIndex - 1);
    }
    Logger.trace("Got raw value [{}] from line #{}", rawValue, getRow());
    wasNull = rawValue == null;
    try {
      result = getDataTypeConverters().convert(rawValue, clazz, true);
    } catch (ClassCastException e) {
      Logger.warn(e, "Not able to convert [{}] to {}", rawValue, clazz);
      if (!quiet) {
        throw new SQLException(e);
      }
    }
  }
  Logger.trace("Return value: raw={}, converted={}", rawValue, result);
  return result;
}

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

private boolean processPositionReport(String line) {
  if (getCommand(null, CommandType.POSITION_REPORT_REGEX) == null) {
    return false;
  }
  if (!line.matches(getCommand(null, CommandType.POSITION_REPORT_REGEX))) {
    return false;
  }
  Logger.trace("Position report: {}", line);
  Matcher matcher =
      Pattern.compile(getCommand(null, CommandType.POSITION_REPORT_REGEX)).matcher(line);
  matcher.matches();
  for (Axis axis : axes) {
    try {
      String s = matcher.group(axis.getName());
      Double d = Double.valueOf(s);
      axis.setCoordinate(d);
    }
    catch (Exception e) {
      Logger.warn("Error processing position report for axis {}: {}", axis.getName(), e);
    }
  }
  ReferenceMachine machine = ((ReferenceMachine) Configuration.get().getMachine());
  for (Head head : Configuration.get().getMachine().getHeads()) {
    machine.fireMachineHeadActivity(head);
  }
  return true;
}

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

Logger.trace("actuatorRead response: {}", line);
Matcher matcher = Pattern.compile(regex).matcher(line);
matcher.matches();

相关文章