Replies: 2 comments 1 reply
-
Hey @mdagit, Intercepting the standard console is generally bad practice. Adze itself is a fancy wrapper around the console to extend it. In order to capture the logs from other libraries, those libraries would need to provide a way to hook into their logs. Unfortunately, most do not do that. If you absolutely must intercept these logs, I would suggest calling adze from your interceptor with the I hope this is helpful! |
Beta Was this translation helpful? Give feedback.
-
Thanks that sounds like it would work. Another idea I had is that you could capture the function reference for console.log when your package is loaded, so that you aren't vulnerable to any later shenanigans. Or (equivalently) offer some configuration for "console_outputter" and the caller could supply something. btw you are probably aware of this (and the reason you are using it), but the builtin console implementation has serialization capabilities that are not easily available to "user land" code. |
Beta Was this translation helpful? Give feedback.
-
I would like to replace the global console with something that calls into an adze logger, so as to intercept random other libs use of it, but when I do that i get an infinite loop because Log.print itself calls into console.
Note sure what to do about that.
Beta Was this translation helpful? Give feedback.
All reactions