/**
 * Copyright(c) Microsoft Corporation.All rights reserved.
 * Licensed under the MIT License.
 */ import chalk from 'chalk' ; export interface ILogger { isError : boolean ; isVerbose : boolean ; command ( message , command ) : void ; error ( message ) : void ; message ( message ) : void ; success ( message , withoutFormat ? ) : void ; warning ( message ) : void ; } export class ConsoleLogger implements ILogger { private _isError : boolean = false ; private _isVerbose : boolean = false ; public get isError ( ) : boolean { return this . _isError ; } public get isVerbose ( ) : boolean { return this . _isVerbose ; } public set isVerbose ( value ) { this . _isVerbose = value || false ; } public error ( message ) { console . error ( chalk . redBright ( message ) ) ; this . _isError = true ; } public message ( message ) { console . log ( chalk . bold ( message ) ) ; } public success ( message ) { console . log ( chalk . greenBright ( message ) ) ; } public warning ( message ) { console . log ( chalk . yellow ( message ) ) ; } public command ( message , command ) { if ( this . isVerbose ) { console . log ( chalk . cyan ( command ) ) ; } else { this . message ( message ) ; } } }