     private let deviceModel = UIDevice.current.model
     private var deviceIdentifier = UIDevice.current.identifierForVendor?.uuidString ?? ""
     private let osVersion = UIDevice.current.systemVersion
+    
+    /// Closure that converts the buffer to data.
+    private let bufferEncode: ([(LogAPI.Level, String)]) -> Data?
     
     /// Stores the log entries in memory until it is ready to send.
     private var buffer: [(LogAPI.Level, String)] = []

                "is_simulator": constants.isRunningOnSimulator
            ],
            "code": [
                "file": file,
                "function": function,
                "line": line
            ]

        let logs = buffer
        buffer = []
        
        guard let data = bufferEncode(logs) else {
            print("🤍 \(timestamp: Date()) PRINT Could not begin log destination task")
            return
        }
