6
6
//
7
7
8
8
import Foundation
9
- import os
9
+ #if canImport(os)
10
+ import os
11
+ #endif
10
12
11
13
public typealias LDKTransactionOutputs = LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ
12
14
public typealias TransactionOutputs = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ
@@ -64,9 +66,10 @@ open class NativeTypeWrapper: Hashable {
64
66
65
67
public class Bindings {
66
68
67
- internal static let logger = os. Logger ( subsystem: Bundle . main. bundleIdentifier!, category: " ldk " )
68
69
internal static var minimumPrintSeverity : PrintSeverity = . WARNING
69
-
70
+ #if canImport(os)
71
+ internal static let logger = os. Logger ( subsystem: Bundle . main. bundleIdentifier!, category: " ldk " )
72
+ #endif
70
73
71
74
public enum PrintSeverity : UInt {
72
75
case DEBUG = 0
@@ -76,15 +79,19 @@ public class Bindings {
76
79
77
80
internal class func print( _ string: String , severity: PrintSeverity = . DEBUG) {
78
81
if severity. rawValue >= Self . minimumPrintSeverity. rawValue {
79
- if severity == Self . PrintSeverity. DEBUG {
80
- logger. debug ( " \( string) " )
81
- } else if severity == Self . PrintSeverity. WARNING {
82
- logger. warning ( " \( string) " )
83
- } else if severity == Self . PrintSeverity. ERROR {
84
- logger. error ( " \( string) " )
85
- } else {
86
- logger. log ( " \( string) " )
87
- }
82
+ #if canImport(os)
83
+ if severity == Self . PrintSeverity. DEBUG {
84
+ logger. debug ( " \( string) " )
85
+ } else if severity == Self . PrintSeverity. WARNING {
86
+ logger. warning ( " \( string) " )
87
+ } else if severity == Self . PrintSeverity. ERROR {
88
+ logger. error ( " \( string) " )
89
+ } else {
90
+ logger. log ( " \( string) " )
91
+ }
92
+ #else
93
+ Swift . print ( string)
94
+ #endif
88
95
}
89
96
}
90
97
@@ -4576,7 +4583,7 @@ withUnsafePointer(to: htlc.cOpaqueStruct!) { (htlcPointer: UnsafePointer<LDKHTLC
4576
4583
}
4577
4584
4578
4585
public class func get_ldk_swift_bindings_version( ) -> String {
4579
- return " 32b7bd5b870675c84f167046cd4e15e754c466b6 "
4586
+ return " 034c20c8e2a658f53ade8a8350a1aa5f36118992 "
4580
4587
}
4581
4588
4582
4589
}
0 commit comments