org.slf4j.Marker.getName()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(211)

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

Marker.getName介绍

[英]Get the name of this Marker.
[中]获取这个标记的名称。

代码示例

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

public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (obj == null)
    return false;
  if (!(obj instanceof Marker))
    return false;
  final Marker other = (Marker) obj;
  return name.equals(other.getName());
}

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

public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (obj == null)
    return false;
  if (!(obj instanceof Marker))
    return false;
  final Marker other = (Marker) obj;
  return name.equals(other.getName());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-slf4j-impl

@Override
public boolean contains(final org.slf4j.Marker marker) {
  if (marker == null) {
    throw new IllegalArgumentException();
  }
  return this.marker.isInstanceOf(marker.getName());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-slf4j-impl

/**
 * Returns a Log4j Marker converted from an existing custom SLF4J Marker.
 * @param marker The SLF4J Marker to convert.
 * @return A converted Log4j/SLF4J Marker.
 * @since 2.1
 */
public Marker getMarker(final Marker marker) {
  if (marker == null) {
    throw new IllegalArgumentException("Marker must not be null");
  }
  final Marker m = markerMap.get(marker.getName());
  if (m != null) {
    return m;
  }
  return addMarkerIfAbsent(marker.getName(), convertMarker(marker));
}

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

public String toString() {
    if (!this.hasReferences()) {
      return this.getName();
    }
    Iterator<Marker> it = this.iterator();
    Marker reference;
    StringBuilder sb = new StringBuilder(this.getName());
    sb.append(' ').append(OPEN);
    while (it.hasNext()) {
      reference = it.next();
      sb.append(reference.getName());
      if (it.hasNext()) {
        sb.append(SEP);
      }
    }
    sb.append(CLOSE);

    return sb.toString();
  }
}

代码示例来源:origin: org.apache.logging.log4j/log4j-slf4j-impl

@Override
  public boolean remove(final Marker marker) {
    return marker != null ? this.marker.remove(MarkerManager.getMarker(marker.getName())) : false;
  }
}

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

public String toString() {
    if (!this.hasReferences()) {
      return this.getName();
    }
    Iterator<Marker> it = this.iterator();
    Marker reference;
    StringBuilder sb = new StringBuilder(this.getName());
    sb.append(' ').append(OPEN);
    while (it.hasNext()) {
      reference = it.next();
      sb.append(reference.getName());
      if (it.hasNext()) {
        sb.append(SEP);
      }
    }
    sb.append(CLOSE);

    return sb.toString();
  }
}

代码示例来源:origin: org.apache.logging.log4j/log4j-slf4j-impl

private static org.apache.logging.log4j.Marker convertMarker(final Marker original,
                               final Collection<Marker> visited) {
  final org.apache.logging.log4j.Marker marker = MarkerManager.getMarker(original.getName());
  if (original.hasReferences()) {
    final Iterator<Marker> it = original.iterator();
    while (it.hasNext()) {
      final Marker next = it.next();
      if (visited.contains(next)) {
        LOGGER.warn("Found a cycle in Marker [{}]. Cycle will be broken.", next.getName());
      } else {
        visited.add(next);
        marker.addParents(convertMarker(next, visited));
      }
    }
  }
  return marker;
}

代码示例来源:origin: org.apache.logging.log4j/log4j-slf4j-impl

@Override
public void add(final Marker marker) {
  if (marker == null) {
    throw new IllegalArgumentException();
  }
  final Marker m = factory.getMarker(marker.getName());
  this.marker.addParents(((Log4jMarker)m).getLog4jMarker());
}

代码示例来源:origin: camunda/camunda-bpm-platform

public boolean equals(Object obj) {
 if (this == obj)
  return true;
 if (obj == null)
  return false;
 if (!(obj instanceof Marker))
  return false;
 final Marker other = (Marker) obj;
 return name.equals(other.getName());
}

代码示例来源:origin: naver/ngrinder

public void shutdown() {
  MarkerFactory.getIMarkerFactory()
      .detachMarker(m_threadMarker.getName());
  m_shutdown = true;
}

代码示例来源:origin: camunda/camunda-bpm-platform

public String toString() {
  if (!this.hasReferences()) {
   return this.getName();
  }
  Iterator it = this.iterator();
  Marker reference;
  StringBuffer sb = new StringBuffer(this.getName());
  sb.append(' ').append(OPEN);
  while (it.hasNext()) {
   reference = (Marker) it.next();
   sb.append(reference.getName());
   if (it.hasNext()) {
    sb.append(SEP);
   }
  }
  sb.append(CLOSE);

  return sb.toString();
 }
}

代码示例来源:origin: naver/ngrinder

@Override
public void setCurrentRunNumber(int run) {
  if (m_runMarker != null) {
    m_threadMarker.remove(m_runMarker);
    MarkerFactory.getIMarkerFactory().detachMarker(
        m_runMarker.getName());
  }
  if (run != -1) {
    m_runMarker = MarkerFactory.getMarker("run-" + run);
    m_threadMarker.add(m_runMarker);
  }
  m_runNumber = run;
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.slf4j.api

public boolean equals(Object obj) {
 if (this == obj)
  return true;
 if (obj == null)
  return false;
 if (!(obj instanceof Marker))
  return false;
 final Marker other = (Marker) obj;
 return name.equals(other.getName());
}

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

public boolean equals(Object obj) {
 if (this == obj)
  return true;
 if (obj == null)
  return false;
 if (!(obj instanceof Marker))
  return false;
 final Marker other = (Marker) obj;
 return name.equals(other.getName());
}

代码示例来源:origin: org.apache.activemq/activemq-all

public boolean equals(Object obj) {
  if (this == obj)
    return true;
  if (obj == null)
    return false;
  if (!(obj instanceof Marker))
    return false;
  final Marker other = (Marker) obj;
  return name.equals(other.getName());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-slf4j18-impl

@Override
public boolean contains(final Marker marker) {
  if (marker == null) {
    throw new IllegalArgumentException();
  }
  return this.marker.isInstanceOf(marker.getName());
}

代码示例来源:origin: org.apache.logging.log4j/log4j-slf4j18-impl

@Override
  public boolean remove(final Marker marker) {
    return marker != null ? this.marker.remove(MarkerManager.getMarker(marker.getName())) : false;
  }
}

代码示例来源:origin: org.apache.logging.log4j/log4j-slf4j18-impl

@Override
public void add(final Marker marker) {
  if (marker == null) {
    throw new IllegalArgumentException();
  }
  final Marker m = factory.getMarker(marker.getName());
  this.marker.addParents(((Log4jMarker)m).getLog4jMarker());
}

代码示例来源:origin: net.sf.grinder/grinder-core

@Override
public void setCurrentRunNumber(int run) {
 if (m_runMarker != null) {
  m_threadMarker.remove(m_runMarker);
  MarkerFactory.getIMarkerFactory().detachMarker(m_runMarker.getName());
 }
 if (run != -1) {
  m_runMarker = MarkerFactory.getMarker("run-" + run);
  m_threadMarker.add(m_runMarker);
 }
 m_runNumber = run;
}

相关文章