question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to reinitialize console transport

See original GitHub issue

Currently console.js in electron-log makes references to console functions (e.g console.log, etc.) during module initialization (source).

This can lead to problems if the application (or its libraries) then make replacements of these functions.

For instance, the Sentry library replaces (wraps) console functions when it is initialized (call to Sentry.init) (source) so it can intercept all log messages and report them to the Sentry service. As electron-log keep reference to the original/unwrapped functions, all messages created with electron-log are invisible to Sentry.

As a consequence this makes electron-log unusable for projects that uses Sentry or similar libraries.

It would be nice to have a way to tell electron-log to reinitialize its console transport. Or (maybe better) console.js would be partially rewritten so it does not keep references to console functions at module initialization and instead uses the console object again each time its methods need to be called.

Thanks for any feedback

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
clemp6rcommented, Dec 7, 2021

@stoefln No, we just postponed integration of log files for now.

0reactions
megahertzcommented, Nov 24, 2022

In v5 console transport has writeFn which allows to override a console call.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Console Port, Telnet, SSH Handling, and Reset Button - Cisco
This task describes how to configure a transport map for a console port interface on the router. Procedure. Purpose. Command or Action. Enables...
Read more >
Restart Desktops and Reset Virtual Machines in Horizon ...
Procedure · In Horizon Console, select Inventory > Machines. · On the vCenter tab, choose to restart a virtual desktop or reset a...
Read more >
Allow config to use console.log only (no console._stdout.write ...
When debugging, console.log in chrome's devtool can display the call stack, which help debugging while console._stdout.write does not.
Read more >
Operations Console LAN - Reset Procedure - IBM
1. Place the system in manual mode: a. Press up arrow until function 02 is displayed, and press Enter. · 2. Enable the...
Read more >
2 Ways to Factory Reset Xbox Series X/S (From Console or ...
I show you 2 ways on how to factory reset back to original factory default settings on an Xbox Series X or Series...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found