public class EmptyLogstashMarker extends LogstashMarker implements StructuredArgument
LogstashMarker.and(Marker)
.
For example:
LogstashMarker marker = Markers.empty(); if (condition1) { marker = marker.and(Markers.append("fieldName1", value1); } if (condition2) { marker = marker.and(Markers.append("fieldName2", value2); }
Modifier and Type | Field and Description |
---|---|
static String |
EMPTY_MARKER_NAME |
MARKER_NAME_PREFIX
Constructor and Description |
---|
EmptyLogstashMarker() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(org.slf4j.Marker other) |
boolean |
contains(String name) |
boolean |
equals(Object obj) |
String |
getName() |
boolean |
hasChildren()
Deprecated.
|
int |
hashCode() |
boolean |
hasReferences() |
Iterator<org.slf4j.Marker> |
iterator() |
boolean |
remove(org.slf4j.Marker referenceToRemove) |
protected String |
toStringSelf()
Returns a string representation of this object, without including any references.
|
void |
writeTo(JsonGenerator generator)
Writes the data associated with this marker to the given
JsonGenerator . |
add, and, toString, with
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
toString
forEach, iterator, spliterator
public static final String EMPTY_MARKER_NAME
public void writeTo(JsonGenerator generator) throws IOException
LogstashMarker
JsonGenerator
.writeTo
in interface StructuredArgument
writeTo
in class LogstashMarker
generator
- the generator to which to write the output of this marker.IOException
- if there was an error writing to the generatorprotected String toStringSelf()
LogstashMarker
Subclasses should override LogstashMarker.toStringSelf()
instead of LogstashMarker.toString()
,
since LogstashMarker.toString()
will automatically include the LogstashMarker.toStringSelf()
and references.
toStringSelf
in class LogstashMarker
public boolean equals(Object obj)
equals
in interface org.slf4j.Marker
public int hashCode()
hashCode
in interface org.slf4j.Marker
public String getName()
getName
in interface org.slf4j.Marker
public boolean hasReferences()
hasReferences
in interface org.slf4j.Marker
@Deprecated public boolean hasChildren()
hasChildren
in interface org.slf4j.Marker
public Iterator<org.slf4j.Marker> iterator()
iterator
in interface org.slf4j.Marker
public boolean remove(org.slf4j.Marker referenceToRemove)
remove
in interface org.slf4j.Marker
public boolean contains(org.slf4j.Marker other)
contains
in interface org.slf4j.Marker
public boolean contains(String name)
contains
in interface org.slf4j.Marker
Copyright © 2013–2021. All rights reserved.