forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
log.ts
39 lines (31 loc) · 942 Bytes
/
log.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import chalk from '../../lib/chalk'
export const prefixes = {
wait: chalk.cyan('wait') + ' -',
error: chalk.red('error') + ' -',
warn: chalk.yellow('warn') + ' -',
ready: chalk.green('ready') + ' -',
info: chalk.cyan('info') + ' -',
event: chalk.magenta('event') + ' -',
trace: chalk.magenta('trace') + ' -',
}
export function wait(...message: any[]) {
console.log(prefixes.wait, ...message)
}
export function error(...message: any[]) {
console.error(prefixes.error, ...message)
}
export function warn(...message: any[]) {
console.warn(prefixes.warn, ...message)
}
export function ready(...message: any[]) {
console.log(prefixes.ready, ...message)
}
export function info(...message: any[]) {
console.log(prefixes.info, ...message)
}
export function event(...message: any[]) {
console.log(prefixes.event, ...message)
}
export function trace(...message: any[]) {
console.log(prefixes.trace, ...message)
}