htsjdk.samtools.util.Log.isEnabled()方法的使用及代码示例

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

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

Log.isEnabled介绍

[英]Returns true if the specified log level is enabled otherwise false.
[中]如果指定的日志级别已启用,则返回true,否则返回false。

代码示例

代码示例来源:origin: samtools/htsjdk

if (isEnabled(level)) {
  StringBuffer tmp = new StringBuffer();
  tmp.append(level.name())

代码示例来源:origin: com.github.samtools/htsjdk

public void setRefMD5(final byte[] ref) {
  alignmentBordersSanityCheck(ref);
  if (sequenceId < 0 && alignmentStart < 1) {
    refMD5 = new byte[16];
    Arrays.fill(refMD5, (byte) 0);
    log.debug("Empty slice ref md5 is set.");
  } else {
    final int span = Math.min(alignmentSpan, ref.length - alignmentStart + 1);
    if (alignmentStart + span > ref.length + 1)
      throw new RuntimeException("Invalid alignment boundaries.");
    refMD5 = SequenceUtil.calculateMD5(ref, alignmentStart - 1, span);
    if (log.isEnabled(Log.LogLevel.DEBUG)) {
      final StringBuilder sb = new StringBuilder();
      final int shoulder = 10;
      if (ref.length <= shoulder * 2)
        sb.append(new String(ref));
      else {
        sb.append(getBrief(alignmentStart, alignmentSpan, ref, shoulder));
      }
      log.debug(String.format("Slice md5: %s for %d:%d-%d, %s",
          String.format("%032x", new BigInteger(1, refMD5)),
          sequenceId, alignmentStart, alignmentStart + span - 1,
          sb.toString()));
    }
  }
}

代码示例来源:origin: com.github.samtools/htsjdk

if (isEnabled(level)) {
  StringBuffer tmp = new StringBuffer();
  tmp.append(level.name())

代码示例来源:origin: org.seqdoop/htsjdk

if (isEnabled(level)) {
  StringBuffer tmp = new StringBuffer();
  tmp.append(level.name());

代码示例来源:origin: samtools/htsjdk

public void setRefMD5(final byte[] ref) {
  alignmentBordersSanityCheck(ref);
  if (sequenceId < 0 && alignmentStart < 1) {
    refMD5 = new byte[16];
    Arrays.fill(refMD5, (byte) 0);
    log.debug("Empty slice ref md5 is set.");
  } else {
    final int span = Math.min(alignmentSpan, ref.length - alignmentStart + 1);
    if (alignmentStart + span > ref.length + 1)
      throw new RuntimeException("Invalid alignment boundaries.");
    refMD5 = SequenceUtil.calculateMD5(ref, alignmentStart - 1, span);
    if (log.isEnabled(Log.LogLevel.DEBUG)) {
      final StringBuilder sb = new StringBuilder();
      final int shoulder = 10;
      if (ref.length <= shoulder * 2)
        sb.append(new String(ref));
      else {
        sb.append(getBrief(alignmentStart, alignmentSpan, ref, shoulder));
      }
      log.debug(String.format("Slice md5: %s for %d:%d-%d, %s",
          String.format("%032x", new BigInteger(1, refMD5)),
          sequenceId, alignmentStart, alignmentStart + span - 1,
          sb.toString()));
    }
  }
}

相关文章