Skip to content

Commit 0e20f2f

Browse files
committed
format cleanup
1 parent 07a1420 commit 0e20f2f

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

Sources/InMemoryTracing/InMemorySpan.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Tracing
1919
///
2020
/// See ``InMemoryTracer``
2121
public struct InMemorySpan: Span {
22-
22+
2323
/// The service context of the span.
2424
public let context: ServiceContext
2525
/// The in-memory span context.
@@ -41,7 +41,7 @@ public struct InMemorySpan: Span {
4141
public var parentSpanID: String? {
4242
spanContext.parentSpanID
4343
}
44-
44+
4545
/// The kind of span
4646
public let kind: SpanKind
4747
/// The time instant the span started.
@@ -55,7 +55,7 @@ public struct InMemorySpan: Span {
5555
private let _status = LockedValueBox<SpanStatus?>(nil)
5656
private let _isRecording = LockedValueBox<Bool>(true)
5757
private let onEnd: @Sendable (FinishedInMemorySpan) -> Void
58-
58+
5959
/// Creates a new in-memory span
6060
/// - Parameters:
6161
/// - operationName: The operation name this span represents.
@@ -88,7 +88,7 @@ public struct InMemorySpan: Span {
8888
public var isRecording: Bool {
8989
_isRecording.withValue { $0 }
9090
}
91-
91+
9292
/// The operation name the span represents.
9393
public var operationName: String {
9494
get {
@@ -99,7 +99,7 @@ public struct InMemorySpan: Span {
9999
_operationName.withValue { $0 = newValue }
100100
}
101101
}
102-
102+
103103
/// The span attributes.
104104
public var attributes: SpanAttributes {
105105
get {
@@ -110,36 +110,36 @@ public struct InMemorySpan: Span {
110110
_attributes.withValue { $0 = newValue }
111111
}
112112
}
113-
113+
114114
/// The events associated with the span.
115115
public var events: [SpanEvent] {
116116
_events.withValue { $0 }
117117
}
118-
118+
119119
/// Adds an event you provide to the span.
120120
/// - Parameter event: The event to record.
121121
public func addEvent(_ event: SpanEvent) {
122122
guard isRecording else { return }
123123
_events.withValue { $0.append(event) }
124124
}
125-
125+
126126
/// The span links.
127127
public var links: [SpanLink] {
128128
_links.withValue { $0 }
129129
}
130-
130+
131131
/// Adds a link to the span.
132132
/// - Parameter link: The link to add.
133133
public func addLink(_ link: SpanLink) {
134134
guard isRecording else { return }
135135
_links.withValue { $0.append(link) }
136136
}
137-
137+
138138
/// The errors recorded by the span.
139139
public var errors: [RecordedError] {
140140
_errors.withValue { $0 }
141141
}
142-
142+
143143
/// Records an error to the span.
144144
/// - Parameters:
145145
/// - error: The error to record.
@@ -155,19 +155,19 @@ public struct InMemorySpan: Span {
155155
$0.append(RecordedError(error: error, attributes: attributes, instant: instant()))
156156
}
157157
}
158-
158+
159159
/// The status of the span.
160160
public var status: SpanStatus? {
161161
_status.withValue { $0 }
162162
}
163-
163+
164164
/// Updates the status of the span to the value you provide.
165165
/// - Parameter status: The status to set.
166166
public func setStatus(_ status: SpanStatus) {
167167
guard isRecording else { return }
168168
_status.withValue { $0 = status }
169169
}
170-
170+
171171
/// Finishes the span.
172172
/// - Parameter instant: the time instant the span completed.
173173
public func end(at instant: @autoclosure () -> some TracerInstant) {
@@ -192,7 +192,7 @@ public struct InMemorySpan: Span {
192192
)
193193
onEnd(finishedSpan)
194194
}
195-
195+
196196
/// An error recorded to a span.
197197
public struct RecordedError: Sendable {
198198
/// The recorded error.
@@ -208,7 +208,7 @@ public struct InMemorySpan: Span {
208208
public struct FinishedInMemorySpan: Sendable {
209209
/// The name of the operation the span represents.
210210
public var operationName: String
211-
211+
212212
/// The service context of the finished span.
213213
public var context: ServiceContext
214214
/// The in-memory span context.
@@ -250,7 +250,7 @@ public struct FinishedInMemorySpan: Sendable {
250250
spanContext.parentSpanID = newValue
251251
}
252252
}
253-
253+
254254
/// The kind of span.
255255
public var kind: SpanKind
256256
/// The time instant the span started.

Sources/InMemoryTracing/InMemorySpanContext.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import ServiceContextModule
1616

1717
/// A type that encapsulates the trace ID, span ID, and parent span ID of an in-memory span.
18-
///
18+
///
1919
/// Generally used through the `ServiceContext/inMemorySpanContext` task local value.
2020
public struct InMemorySpanContext: Sendable, Hashable {
2121
/// The idenfifier of top-level trace of which this span is a part of.
@@ -26,7 +26,7 @@ public struct InMemorySpanContext: Sendable, Hashable {
2626

2727
/// The Identifier of the parent of this span, if any.
2828
public var parentSpanID: String?
29-
29+
3030
/// Creates a new in-memory span context.
3131
/// - Parameters:
3232
/// - traceID: The trace ID for the context.

Sources/InMemoryTracing/InMemoryTracer.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public struct InMemoryTracer: Tracer {
4343
var _state = LockedValueBox<State>(.init())
4444

4545
/// Create a new ``InMemoryTracer``.
46-
///
46+
///
4747
/// - Parameters:
4848
/// - idGenerator: strategy for generating trace and span identifiers
4949
/// - recordInjections: A Boolean value that indicates whether the tracer records injected values.
@@ -62,7 +62,7 @@ public struct InMemoryTracer: Tracer {
6262
// MARK: - Tracer
6363

6464
extension InMemoryTracer {
65-
65+
6666
/// Start a new span and automatically ends the span when the operation completes, including recording the error in case the operation throws.
6767
/// - Parameters:
6868
/// - operationName: The name of the operation being traced.
@@ -119,7 +119,7 @@ extension InMemoryTracer {
119119
_state.withValue { $0.activeSpans[spanContext] = span }
120120
return span
121121
}
122-
122+
123123
/// Records a request to flush spans.
124124
public func forceFlush() {
125125
_state.withValue { $0.numberOfForceFlushes += 1 }
@@ -189,12 +189,12 @@ extension InMemoryTracer {
189189
// MARK: - Instrument
190190

191191
extension InMemoryTracer {
192-
192+
193193
/// The trace ID key for the in-memory tracer.
194194
public static let traceIDKey = "in-memory-trace-id"
195195
/// The span ID key for the in-memory tracer.
196196
public static let spanIDKey = "in-memory-span-id"
197-
197+
198198
/// Collects the service context you provide and inserts it into tracing carrier.
199199
/// - Parameters:
200200
/// - context: The service context to add.
@@ -245,7 +245,7 @@ extension InMemoryTracer {
245245
}
246246

247247
extension InMemoryTracer {
248-
248+
249249
/// Retrieves and returns the service context from the tracing carrier.
250250
/// - Parameters:
251251
/// - carrier: The service implementation from which to extract the service context.
@@ -303,7 +303,7 @@ extension InMemoryTracer {
303303
public let nextTraceID: @Sendable () -> String
304304
/// A closure that creates a span ID.
305305
public let nextSpanID: @Sendable () -> String
306-
306+
307307
/// Creates a new instance of an ID generator using the closures you provide.
308308
/// - Parameters:
309309
/// - nextTraceID: The closure to create the next trace ID.
@@ -315,7 +315,7 @@ extension InMemoryTracer {
315315
self.nextTraceID = nextTraceID
316316
self.nextSpanID = nextSpanID
317317
}
318-
318+
319319
/// An ID generator that provides incrementing IDs using a simple sequential numeric scheme.
320320
public static var incrementing: IDGenerator {
321321
let traceID = LockedValueBox<Int>(0)

Sources/Instrumentation/MultiplexInstrument.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public struct MultiplexInstrument {
2020
private var instruments: [Instrument]
2121

2222
/// Create a multiplex instrument.
23-
///
23+
///
2424
/// - Parameter instruments: An array of ``Instrument``, each of which the tracer uses to
2525
/// ``Instrument/inject(_:into:using:)`` or ``Instrument/extract(_:into:using:)``
2626
/// through the same `ServiceContext`.

0 commit comments

Comments
 (0)