Skip to content

Commit

Permalink
chore: use swift logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Katerina Tafoya committed Jul 16, 2024
1 parent 5c3f190 commit bd515f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Sources/OpenTelemetrySdk/Trace/SpanBuilderSdk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import Foundation

import OpenTelemetryApi
import SwiftyBeaver
import Logging

let swiftLogger = Logger(label: "OpenTelemetrySDK")
/// SpanBuilderSdk is SDK implementation of SpanBuilder.
class SpanBuilderSdk: SpanBuilder {
private enum ParentType {
Expand Down Expand Up @@ -159,7 +161,7 @@ class SpanBuilderSdk: SpanBuilder {
OpenTelemetry.instance.contextProvider.setActiveSpan(createdSpan)
}

SpanBuilderSdk.logger.debug("SpanBuilderSdk.\(#function): created span: \(createdSpan)")
swiftLogger.debug("SpanBuilderSdk.\(#function): created span: \(createdSpan)")

return createdSpan
}
Expand All @@ -175,7 +177,7 @@ class SpanBuilderSdk: SpanBuilder {
private func getParentContext(parentType: ParentType, explicitParent: Span?, remoteParent: SpanContext?) -> SpanContext? {
let currentSpan = OpenTelemetry.getActiveSpan()

SpanBuilderSdk.logger.debug("SpanBuilderSDK.\(#function): active span: \(String(describing: currentSpan))")
swiftLogger.debug("SpanBuilderSDK.\(#function): active span: \(String(describing: currentSpan))")

var parentContext: SpanContext?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public struct SimpleSpanProcessor: SpanProcessor {
let span = span.toSpanData()
let spanExporterAux = self.spanExporter

SimpleSpanProcessor.logger.debug("SimpleSpanProcessor.\(#function): spanData: \(span)")
swiftLogger.debug("SimpleSpanProcessor.\(#function): spanData: \(span)")

processorQueue.async {
_ = spanExporterAux.export(spans: [span])
Expand Down

0 comments on commit bd515f0

Please sign in to comment.