Allow to reinitialize console transport
See original GitHub issueCurrently 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:
- Created 2 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top GitHub Comments
@stoefln No, we just postponed integration of log files for now.
In v5 console transport has
writeFn
which allows to override a console call.