Skip to content

Commit a35b0c0

Browse files
committed
Updated logging
1 parent 01acf4e commit a35b0c0

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

Sources/Decoder.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public struct TLVDecoder {
3030

3131
public func decode <T: Decodable> (_ type: T.Type, from data: Data) throws -> T {
3232

33+
log?("Will decode \(String(reflecting: T.self))")
34+
3335
let items = try decode(data)
3436

3537
let options = Decoder.Options(numericFormat: numericFormat)

Sources/Encoder.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public struct TLVEncoder {
3030

3131
public func encode <T: Encodable> (_ value: T) throws -> Data {
3232

33+
log?("Will encode \(String(reflecting: T.self))")
34+
3335
let options = Encoder.Options(numericFormat: numericFormat)
3436
let encoder = Encoder(userInfo: userInfo, log: log, options: options)
3537
try value.encode(to: encoder)
@@ -594,6 +596,7 @@ internal final class TLVUnkeyedEncodingContainer: UnkeyedEncodingContainer {
594596
private extension TLVEncodable {
595597

596598
var copyingBytes: Data {
599+
597600
#if swift(>=5)
598601
return withUnsafePointer(to: self, { Data(bytes: $0, count: MemoryLayout<Self>.size) })
599602
#else

0 commit comments

Comments
 (0)