sindresorhus / electron-timber

Pretty logger for Electron apps
MIT License
404 stars 13 forks source link

Filter out Electron junk logging #13

Open sindresorhus opened 6 years ago

sindresorhus commented 6 years ago

See https://github.com/electron/electron/issues/12438#issuecomment-376667373

Electron logs a lot of annoying stuff and it doesn't seem like it will be fixed upstream anytime soon.

Here's what I get in the app I'm working on:

2018-05-07 02:20:07.532 Electron[5632:177578] *** WARNING: Textured window <AtomNSWindow: 0x7f951ec62830> is getting an implicitly transparent titlebar. This will break when linking against newer SDKs. Use NSWindow's -titlebarAppearsTransparent=YES instead.
2018-05-07 02:20:08.440 Electron Helper[5635:177698] Couldn't set selectedTextBackgroundColor from default ()
[5632:0507/022008.491482:ERROR:CONSOLE(7574)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7574)
[5632:0507/022009.415028:ERROR:CONSOLE(7574)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7574)
[5632:0507/022010.414003:ERROR:CONSOLE(7574)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7574)
[5632:0507/022011.413684:ERROR:CONSOLE(7574)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7574)
[5632:0507/022012.415183:ERROR:CONSOLE(7574)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7574)
[5632:0507/022013.415071:ERROR:CONSOLE(7574)] "Extension server error: Operation failed: : has no execution context", source: chrome-devtools://devtools/bundled/inspector.js (7574)

Another error we should filter out:

[93943:0510/142524.901813:ERROR:CONSOLE(105)] "Uncaught (in promise) Error: Could not instantiate: ProductRegistryImpl.Registry", source: chrome-devtools://devtools/bundled/inspector.js (105)
sindresorhus commented 6 years ago

Should also filter out the security warning from the terminal output. It's still visible in the DevTools console. https://github.com/sindresorhus/electron-timber/pull/10#issuecomment-386863362

sindresorhus commented 4 years ago

See https://github.com/sindresorhus/electron-timber/pull/19 for inspiration if you want to work on this issue.