Use debug() instead of console.error()

Silents the module by default and also prints the error
object in case its wanted. Ideally there would be a way
to catch 'end' and 'error' upstream.