import boxen from 'boxen' ; import logSymbols from 'log-symbols' ; import logger , { LogLevels } from './logger' ; export default boxen ; param level param msg export const print = ( level , msg ) : void => { const boxed = boxen ( msg , { padding : 1 , margin : 1 , } ) ; logger [ level ] ( boxed ) ; } ; param msg param showSymbol export const warning = ( msg , showSymbol = true ) : void => { const sym = logSymbols . warning ; if ( showSymbol ) { msg = `${ sym } ${ msg } ${ sym }` ; } print ( 'warning' , msg ) ; } ; param msg param showSymbol export const info = ( msg , showSymbol = true ) : void => { const sym = logSymbols . info ; if ( showSymbol ) { msg = `${ sym } ${ msg } ${ sym }` ; } print ( 'info' , msg ) ; } ; param msg param showSymbol export const error = ( msg , showSymbol = true ) : void => { const sym = logSymbols . error ; if ( showSymbol ) { msg = `${ sym } ${ msg } ${ sym }` ; } print ( 'error' , msg ) ; } ; param msg param showSymbol export const success = ( msg , showSymbol = true ) : void => { const sym = logSymbols . success ; if ( showSymbol ) { msg = `${ sym } ${ msg } ${ sym }` ; } print ( 'success' , msg ) ; } ;