article-writer-cn
Version:
AI 驱动的智能写作系统 - 专注公众号/自媒体文章创作
25 lines (20 loc) • 626 B
text/typescript
import chalk from 'chalk'
export const logger = {
info: (message: string, ...args: any[]) => {
console.log(chalk.blue('ℹ'), message, ...args)
},
success: (message: string, ...args: any[]) => {
console.log(chalk.green('✓'), message, ...args)
},
warn: (message: string, ...args: any[]) => {
console.log(chalk.yellow('⚠'), message, ...args)
},
error: (message: string, ...args: any[]) => {
console.error(chalk.red('✗'), message, ...args)
},
debug: (message: string, ...args: any[]) => {
if (process.env.DEBUG) {
console.log(chalk.gray('⚙'), message, ...args)
}
}
}