Skip to content

Commit 60a9059

Browse files
committed
feat(context): Add toString() for debugging purpose
1 parent 7e4b40a commit 60a9059

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

components/context/src/main/java/datadog/context/SingletonContext.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,9 @@ public int hashCode() {
5757
result = 31 * result + Objects.hashCode(this.value);
5858
return result;
5959
}
60+
61+
@Override
62+
public String toString() {
63+
return "SingletonContext{" + "index=" + this.index + ", value=" + this.value + '}';
64+
}
6065
}

internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTracer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,11 @@ public long getSpanId() {
606606
public AgentSpanContext context() {
607607
return this.spanContext;
608608
}
609+
610+
@Override
611+
public String toString() {
612+
return "ExtractedSpan{spanContext=" + this.spanContext + '}';
613+
}
609614
}
610615

611616
public static class NoopAgentSpan implements AgentSpan {

0 commit comments

Comments
 (0)