import chalk from 'chalk' ; import { execStateConfig , userConfig } from '../config' ; export function logMessageFromGraphite ( msg ) { console . log ( chalk . yellow ( msg ) + '\n\n' ) ; } export function logError ( msg ) { console . log ( chalk . redBright ( `ERROR: ${ msg }` ) ) ; } export function logWarn ( msg ) { console . log ( chalk . yellow ( `WARNING: ${ msg }` ) ) ; } export function logInfo ( msg ) { if ( ! execStateConfig . quiet ( ) ) { console . log ( `${ msg }` ) ; } } export function logSuccess ( msg ) { if ( ! execStateConfig . quiet ( ) ) { console . log ( chalk . green ( `${ msg }` ) ) ; } } export function logDebug ( msg ) { if ( execStateConfig . outputDebugLogs ( ) ) { console . log ( msg ) ; } } export function logTip ( msg ) { if ( ! execStateConfig . quiet ( ) && userConfig . tipsEnabled ( ) ) { console . log ( chalk . gray ( [ '' , `${ chalk . bold ( 'tip' ) }: ${ msg }` , chalk . italic ( 'Feeling expert? "gt user tips --disable"' ) , ] . join ( '\n' ) ) ) ; } } export function logNewline ( ) { if ( ! execStateConfig . quiet ( ) ) { console . log ( '' ) ; } }