console.log to output variable values or other status updates.
But as the thing you’re working on gets more complicated you can have a lot of logging going on. It’s helpful to be able to visually differentiate the different messages and/or filter them by what type of information they are.
So I wrote a little helper function to make things a bit easier:
It’s intended as a partial to be used with something like CodeKit but can just be dropped in the old-fashioned way too. It has no dependencies so should be widely compatible, though right now I've only tested it as part of a jQuery project.
It’s pretty much self-documenting so I won’t repeat what the comment says. I’ve MIT-licensed it so you’re basically free to do as you wish with it, though contributing back any improvements is always appreciated!
Posted on Tuesday, 10th February 2015.
Sorry, feedback is now closed on this post, but please feel free to get in touch if you would like to talk about it!