Java Code Examples for org.slf4j.Marker#iterator()
The following examples show how to use
org.slf4j.Marker#iterator() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Log4jMarkerFactory.java From logging-log4j2 with Apache License 2.0 | 6 votes |
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; }
Example 2
Source File: Log4jMarkerFactory.java From logging-log4j2 with Apache License 2.0 | 6 votes |
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; }
Example 3
Source File: EcsEncoder.java From ecs-logging-java with Apache License 2.0 | 5 votes |
private void serializeMarker(StringBuilder builder, Marker marker) { if (marker != null) { EcsJsonSerializer.serializeSingleTag(builder, marker.getName()); Iterator<Marker> it = marker.iterator(); while (it.hasNext()) { serializeMarker(builder, it.next()); } } }
Example 4
Source File: GelfEncoder.java From logback-gelf with GNU Lesser General Public License v2.1 | 5 votes |
private static String buildMarkerStr(final Marker marker) { if (!marker.hasReferences()) { return marker.getName(); } final StringBuilder sb = new StringBuilder(marker.getName()); final Iterator<Marker> it = marker.iterator(); do { sb.append(", ").append(it.next().getName()); } while (it.hasNext()); return sb.toString(); }
Example 5
Source File: CategoriesConverter.java From cf-java-logging-support with Apache License 2.0 | 5 votes |
private void getMarkersRecursively(Marker marker, ArrayComposer<JSONComposer<String>> ac) throws IOException { if (marker != null) { ac.add(marker.getName()); Iterator<Marker> it = marker.iterator(); while (it.hasNext()) { getMarkersRecursively(it.next(), ac); } } }
Example 6
Source File: DolphinLogger.java From dolphin-platform with Apache License 2.0 | 5 votes |
private List<String> convert(final Marker marker) { Objects.requireNonNull(marker); List<String> ret = new ArrayList<>(); ret.add(marker.getName()); Iterator<Marker> children = marker.iterator(); while (children.hasNext()) { ret.addAll(convert(children.next())); } return ret; }