I recently used the same thing to have color-coded logging on my node app :)
looks a little something like this:
function debug(message) { const timestamp = new Date().toString() console.log('\x1b[36m%s\x1b[0m', `${timestamp} - ${message}`) } function error(message) { const timestamp = new Date().toString() console.error('\x1b[31m%s\x1b[0m', `${timestamp} - ${message}`) }
Hey v 1 r t l & Andre,
thanks for your tips, I will have a look at it.
If anyone is interested in further information: various escape codes bigger discussion on stackoverflow
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I recently used the same thing to have color-coded logging on my node app :)
looks a little something like this:
Hey v 1 r t l & Andre,
thanks for your tips,
I will have a look at it.
If anyone is interested in further information:
various escape codes
bigger discussion on stackoverflow