File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 6
6
//
7
7
8
8
import Foundation
9
+ import os
9
10
10
11
public typealias LDKTransactionOutputs = LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ
11
12
public typealias TransactionOutputs = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ
@@ -63,6 +64,7 @@ open class NativeTypeWrapper: Hashable {
63
64
64
65
public class Bindings {
65
66
67
+ internal static let logger = os. Logger ( subsystem: Bundle . main. bundleIdentifier!, category: " ldk " )
66
68
internal static var minimumPrintSeverity : PrintSeverity = . WARNING
67
69
68
70
public enum PrintSeverity : UInt {
@@ -73,7 +75,15 @@ public class Bindings {
73
75
74
76
internal class func print( _ string: String , severity: PrintSeverity = . DEBUG) {
75
77
if severity. rawValue >= Self . minimumPrintSeverity. rawValue {
76
- Swift . print ( string)
78
+ if severity == Self . PrintSeverity. DEBUG {
79
+ logger. debug ( " \( string) " )
80
+ } else if severity == Self . PrintSeverity. WARNING {
81
+ logger. warning ( " \( string) " )
82
+ } else if severity == Self . PrintSeverity. ERROR {
83
+ logger. error ( " \( string) " )
84
+ } else {
85
+ logger. log ( " \( string) " )
86
+ }
77
87
}
78
88
}
79
89
You can’t perform that action at this time.
0 commit comments