Added support to replace console.error