import Chalk from 'chalk' ; export class Logger { private prefix = `[${ this . name }] ` ; constructor ( readonly name ) { } info ( message ) { console . info ( prefix ( message , Chalk . blue ( this . prefix ) ) ) ; } warn ( message ) { console . warn ( prefix ( message , Chalk . yellow ( this . prefix ) ) ) ; } error ( message ) { console . error ( prefix ( message , Chalk . red ( this . prefix ) ) ) ; } } export function prefix ( text , prefix ) { return text . replace ( /^/gm , prefix ) ; }