Port duplex to use loglevel instead of console.log