         - parameter terminationHandler: Called when the middleware is done. Does not mean that all encoding is done.
     */
     public func setupMiddleware(_ middleware: Process, terminationHandler: (() -> ())?) {
+        DefaultDiscordLogger.Logger.debug("Setting up middleware", type: logType)
+
         encoder.middleware = DiscordEncoderMiddleware(encoder: encoder,
                                                       middleware: middleware,
                                                       terminationHandler: terminationHandler)

        let base = voiceServerInformation.endpoint.components(separatedBy: ":")[0]
        let udpEndpoint = InternetAddress(hostname: base, port: UInt16(udpPort))

        guard let client = try? UDPInternetSocket(address: udpEndpoint) else {
            disconnect()


            self.disconnect()
        }

        DefaultDiscordLogger.Logger.debug("VoiceEngine is ready!", type: logType)

        readSocket()
    }

