JS: logging function with color coded output