I consider myself a backend software engineer - and as any backend engineer would attest, a large part of our life is spent monitoring, troubleshoo...
For further actions, you may consider blocking this person and/or reporting abuse
You wrote: "Donβt use console.log() Instead, write a wrapper class..."
Console.log()/table()/etc... print in console place (filename and string number) where was he called.
joxi.ru/gmv6P5LsqgZKEm?d=1
If wrap console.log() in class in console always printing file and string number where console.log() is live in Log class!!. How can I know without additional params where log() was called?
Good question, which drives home the reason why this tip was listed under the production logging section and not development or debugging. The question you'd need to ask yourself is how useful is it to have that extra file:line link there? If you're doing things right and have compressed / minified your app's assets in production you're likely not going to find the location link useful anyway - instead your log messages should have all the info you need to identify where the log is emitted from and be actionable. Also keep in mind that console.trace() will still have the entire stack trace one level down even when invoked from a wrapper.
Do not write a wrapper around console.log, unless you're using an opinionated framework like React or Angular, which then you can expose the functionality via a custom, injectable service. Otherwise, do use console.log or any language equivalent and stay away from heavy-handed logging frameworks.
Awesome article. I've never even heard about these console methods as .table, .trace, etc. Very informative. Thank you! π€
Very useful tips, thanks π
Great...
Thank you for sharing :D
Thanks for the tips!
Great article! I will start immediately to use this stuff!
Very useful, never knew you can do so much to improve console logs!
Great article thanks for share π
console.table() = love! Thank you, never used before!
Excellent! This article is really useful.
Thank you for sharing the article.
Uhhh interesting article... ti bad Javascript doesnt show up on firecode will get by as I learn a bit of Java !
These are some really useful tips! Nice work. For anyone interested in Chrome DevTools tips, I've posted loads here: umaar.com/dev-tips/
Very interesting and useful. Mostly new topics to me and I will be integrating most of these techniques into my applications.
Good article