             msg = JSON.stringify(params)
             bytes = msg.length
             @bytesSent += bytes
-            @logStream.write("#{Date()}  -- Sent #{bytes} characters (#{msg})\n")
+            @bwLogStream.write("#{Date()}  -- Sent #{bytes} characters (#{msg})\n")
 
     pauseRendering : () =>
         @emit 'DOMEvent',

        msg = JSON.stringify(params)
        bytes = msg.length
        @bytesReceived += bytes
        @logStream.write("#{Date()}  -- Recv #{bytes} characters (#{msg})\n")
        @clientAPI.DOMUpdate(params)

    processComponentEvent : (params) ->
        node = @dom.nodes.get(params.nodeID)
        if !node
            throw new Error("Invalid component nodeID: #{params.nodeID}")

                    args = Array.prototype.slice.call(arguments)
                    args.push('\n')
                    str = args.join(' ')
                    self.consoleLogStream.write(str)
                    # For connected debug clients.
                    self.emit('log', str)

        if process.env.TESTS_RUNNING
