Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

typescript how to color your console loggers

//has to be backtick comma to interpolate.
public colorLogger(str: any, color = "red"){
    console.log(`%c ${str}`, `color: ${color}; font-weight: bold;`);
}
Source by www.samanthaming.com #
 
PREVIOUS NEXT
Tagged: #typescript #color #console #loggers
ADD COMMENT
Topic
Name
2+1 =