You are reading content from Scuttlebutt
@Christian Bundy %fbKq/q66IYCANa43sD6NLgHXg/w+WMpZbKzUfxk+pOo=.sha256

Electron, Debug, and redefining console.log

We're doing a thing in #patchwork and #patchbay where we redefine console.log to make it log to both the browser console and the terminal console. Historically this has been fine, but as more packages start using debug we're starting to have an issue with their web browser integration.

Long story short, the web browser console takes color codes in a different format than the terminal, so those browser logs are being output to the terminal as a big unreadable mess. No good. The two solutions, as I see them:

  • stop using debug, and have our dependencies stop using debug
  • stop redefining console.log to output browser logs to the terminal (my preference)

Anyway, I'm sure it will annoy someone eventually, so I just wanted to document both the problem and the solution. Does anyone mind if we stop sending browser logs to the terminal?

cc: #somebody-should #patchwork-dev #patchbay-dev

Join Scuttlebutt now