org.modeshape.common.logging.Logger.trace()方法的使用及代码示例

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

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

Logger.trace介绍

[英]Log a message at the TRACE level according to the specified format and (optional) parameters. The message should contain a pair of empty curly braces for each of the parameter, which should be passed in the correct order. This method is efficient and avoids superfluous object creation when the logger is disabled for the TRACE level.
[中]根据指定的格式和(可选)参数在跟踪级别记录消息。消息应该为每个参数包含一对空大括号,并且应该按照正确的顺序传递。此方法非常有效,并避免了在为跟踪级别禁用记录器时创建多余的对象。

代码示例

代码示例来源:origin: org.fcrepo/modeshape-jcr

@Override
public void trace( String message,
          Object... params ) {
  logger.trace(message, params);
}

代码示例来源:origin: ModeShape/modeshape

@Override
public void commit( ITransaction transaction ) throws WebdavException {
  // do nothing
  LOG.trace("LocalFileSystemStore.commit()");
}

代码示例来源:origin: org.modeshape/modeshape-web-jcr

@Override
public void trace( Throwable t,
          String message,
          Object... params ) {
  logger.trace(t, message, params);
}

代码示例来源:origin: ModeShape/modeshape

@Override
public long getResourceLength( ITransaction transaction,
                String resourceUri ) throws WebdavException {
  LOG.trace("LocalFileSystemStore.getResourceLength(" + resourceUri + ")");
  File file = new File(root, resourceUri);
  return file.length();
}

代码示例来源:origin: ModeShape/modeshape

@Override
public void createFolder( ITransaction transaction,
             String uri ) throws WebdavException {
  LOG.trace("LocalFileSystemStore.createFolder(" + uri + ")");
  File file = new File(root, uri);
  if (!file.mkdir()) {
    throw new WebdavException("cannot create folder: " + uri);
  }
}

代码示例来源:origin: ModeShape/modeshape

@Override
  public boolean isCurrentRowValid( Batch batch ) {
    Object key = keyExtractor.getValueInRow(batch);
    if (!rowsSeen.addIfAbsent(key)) {
      if (trace) LOGGER.trace("Distinct found existing key: {0}", key);
      return false;
    }
    if (trace) LOGGER.trace("Distinct found new key: {0}", key);
    return true;
  }
};

代码示例来源:origin: ModeShape/modeshape

@Override
public void remove( String nodeKey,
          String propertyName, 
          T value ) {
  // Find all of the T values (entry keys) for the given node key (entry values) ...
  for (T key : Fun.filter(valuesByKey, nodeKey)) {
    if (comparator.compare(value, key) == 0) {
      logger.trace("Removing node '{0}' from '{1}' index with value '{2}'", nodeKey, name, value);
      keysByValue.remove(key);
    }
  }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

@Override
public void remove( String nodeKey,
          String propertyName, 
          T value ) {
  // Find all of the T values (entry keys) for the given node key (entry values) and remove those which have value 'value'
  for (UniqueKey<T> key : Fun.filter(valuesByKey, nodeKey)) {
    if (key.actualKey.equals(value)) {
      logger.trace("Removing node '{0}' from '{1}' index with value '{2}'", nodeKey, name, key.actualKey);
      keysByValue.remove(key);
    }
  }
}

代码示例来源:origin: ModeShape/modeshape

@Override
public void remove( String nodeKey ) {
  // Find all of the T values (entry keys) for the given node key (entry values) ...
  for (T key : Fun.filter(valuesByKey, nodeKey)) {
    logger.trace("Removing node '{0}' from '{1}' index with value '{2}'", nodeKey, name, key);
    keysByValue.remove(key);
  }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

@Override
public void rollback() throws IllegalStateException, SecurityException, SystemException {
  if (logger.isTraceEnabled()) {
    logger.trace("Rolling back transaction '{0}'", id);
  }
  super.rollback();
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

@Override
  public void commit()
      throws RollbackException, SecurityException,
          IllegalStateException, SystemException {
    if (logger.isTraceEnabled()) {
      super.commit();
      logger.trace("Committed transaction '{0}'", id);
    } else {
      super.commit();
    }
  }
}

代码示例来源:origin: ModeShape/modeshape

@Override
public Object getValueInRow( RowAccessor row ) {
  CachedNode node = row.getNode(indexInRow);
  if (node == null) return null;
  Name name = node.getName(cache);
  if (trace) NodeSequence.LOGGER.trace("Extracting name from {0}: {1}", node.getPath(cache), name);
  return name;
}

代码示例来源:origin: ModeShape/modeshape

@Override
public Object getValueInRow( RowAccessor row ) {
  CachedNode node = row.getNode(indexInRow);
  if (node == null) return null;
  NodeKey parentKey = node.getParentKey(cache);
  if (trace) NodeSequence.LOGGER.trace("Extracting parent key from {0}: {1}", node.getPath(cache), parentKey);
  return parentKey != null ? parentKey.toString() : null;
}

代码示例来源:origin: ModeShape/modeshape

@Override
public Object getValueInRow( RowAccessor row ) {
  CachedNode node = row.getNode(indexInRow);
  String name = node.getName(cache).getLocalName();
  if (trace) NodeSequence.LOGGER.trace("Extracting name from {0}: {1}", node.getPath(cache), name);
  return name;
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

@Override
public Object getValueInRow( RowAccessor row ) {
  CachedNode node = row.getNode(indexInRow);
  String name = node.getName(cache).getLocalName();
  if (trace) NodeSequence.LOGGER.trace("Extracting name from {0}: {1}", node.getPath(cache), name);
  return name;
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

@Override
public Object getValueInRow( RowAccessor row ) {
  CachedNode node = row.getNode(indexInRow);
  if (node == null) return null;
  NodeKey parentKey = node.getParentKey(cache);
  if (parentKey == null) return null;
  CachedNode parent = cache.getNode(parentKey);
  if (parent == null) return null;
  Path parentPath = parent.getPath(cache);
  if (trace) NodeSequence.LOGGER.trace("Extracting parent path from {0}: {1}", node.getPath(cache), parentPath);
  return parentPath;
}

代码示例来源:origin: ModeShape/modeshape

@Override
public Object getValueInRow( RowAccessor row ) {
  CachedNode node = row.getNode(indexInRow);
  if (node == null) return null;
  NodeKey parentKey = node.getParentKey(cache);
  if (parentKey == null) return null;
  CachedNode parent = cache.getNode(parentKey);
  if (parent == null) return null;
  Path parentPath = parent.getPath(cache);
  if (trace) NodeSequence.LOGGER.trace("Extracting parent path from {0}: {1}", node.getPath(cache), parentPath);
  return parentPath;
}

代码示例来源:origin: ModeShape/modeshape

@Override
public Document get( String key ) {
  LOGGER.debug("reading {0}", key);
  TransactionStore.TransactionMap<String, Document> txContent = transactionalContent(false);
  Document result = txContent != null ? txContent.getLatest(key) : persistedContent.get(key);
  if (LOGGER.isTraceEnabled()) {
    LOGGER.trace("{0} is {1}", key, result);
  }
  return result;
}

代码示例来源:origin: ModeShape/modeshape

@Test
public void shouldLogAppropriateMessagesIfLog4jSetToErrorLevel() {
  log4jLogger.setLevel(Level.ERROR);
  logger.error(errorMessageWithNoParameters);
  logger.warn(warningMessageWithNoParameters);
  logger.info(infoMessageWithNoParameters);
  logger.debug("This is a debug message with no parameters");
  logger.trace("This is a trace message with no parameters");
  log.removeFirst(Logger.Level.ERROR, "This is an error message with no parameters");
  assertEquals(false, log.hasEvents());
}

代码示例来源:origin: ModeShape/modeshape

@Test
public void shouldLogAppropriateMessagesIfLog4jSetToWarningLevel() {
  log4jLogger.setLevel(Level.WARN);
  logger.error(errorMessageWithNoParameters);
  logger.warn(warningMessageWithNoParameters);
  logger.info(infoMessageWithNoParameters);
  logger.debug("This is a debug message with no parameters");
  logger.trace("This is a trace message with no parameters");
  log.removeFirst(Logger.Level.ERROR, "This is an error message with no parameters");
  log.removeFirst(Logger.Level.WARNING, "This is a warning message with no parameters");
  assertEquals(false, log.hasEvents());
}

相关文章