NPM debugging package #435
Replies: 5 comments
-
Some of the benefits would be:
|
Beta Was this translation helpful? Give feedback.
-
+1 though about this before for Dotcom too and I've seen epic or banner code that does some debug logging too. I think the ideal thing for us is to be able to only include debug code in a bundle when required (if it's for PROD debugging for example). We can dynamically import based on localstorage, we don't want to include debug code for users that don't need it |
Beta Was this translation helpful? Give feedback.
-
@alexduf did some work to create a universal logger for us on Apps-Rendering. Depending on where code is running (client/server/CODE/PROD etc.) it provides differing functionality, and prefixes each log message with extra information. |
Beta Was this translation helpful? Give feedback.
-
Yes! I don't know how relevant that is for other projects, but the trick being:
|
Beta Was this translation helpful? Give feedback.
-
@jacobwinch may also be interested in this. |
Beta Was this translation helpful? Give feedback.
-
In the commercial dev group, a lot of information we work with is invisible, so we rely heavily on the console to debug and test things.
I was wondering if there was any interest in making a
debug mode
package for accessible for all client-side projects at The Guardian. Initial thoughts would be to have agu.debug
object in localStorage, shaped like so:And in the code you could
console.log("commercial", "😲")
→guDebug.commercial("😲")
.There is a bit more work required to think about how this would work in practice, but it might also help tag Sentry errors per team, if calls to the console always start with a team identifier?
Beta Was this translation helpful? Give feedback.
All reactions