Skip to content

Commit 6739426

Browse files
authored
Repair CircleCI and linux tests (#72)
* Fixed UIScreenTracking log issue * Fix logging for linux
1 parent 39a04cc commit 6739426

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Examples/other_plugins/UIKitScreenTracking.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ extension UIViewController {
122122
guard let top = Self.seg__visibleViewController(activeController()) else { return }
123123

124124
var name = String(describing: top.self.classForCoder).replacingOccurrences(of: "ViewController", with: "")
125-
analytics?.log(message: "Auto-tracking Screen: \(name)")
125+
print("Auto-tracking Screen: \(name)")
126126
// name could've been just "ViewController"...
127127
if name.count == 0 {
128128
name = top.title ?? "Unknown"

Sources/Segment/Plugins/Logger/SegmentLogger.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ internal class Logger: UtilityPlugin {
2222

2323
func configure(analytics: Analytics) {
2424
self.analytics = analytics
25+
#if !os(Linux)
2526
try? add(target: SystemTarget(), for: LoggingType.log)
27+
#else
28+
try? add(target: ConsoleTarget(), for: LoggingType.log)
29+
#endif
2630
}
2731

2832
func update(settings: Settings) {

Sources/Segment/Plugins/Logger/SystemTarget.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by Cody Garvin on 8/20/21.
66
//
77

8+
#if !os(Linux)
9+
810
import Foundation
911
import os.log
1012

@@ -50,3 +52,5 @@ class SystemTarget: LogTarget {
5052
return osLogType
5153
}
5254
}
55+
56+
#endif

0 commit comments

Comments
 (0)