File size: 830 Bytes
a5d1c1b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 pc from 'picocolors';

export const logger = {
  success(message: string): void {
    console.log(`${pc.green('✓')} ${message}`);
  },

  info(message: string): void {
    console.log(`${pc.blue('ℹ')} ${message}`);
  },

  warn(message: string): void {
    console.warn(`${pc.yellow('⚠️')} ${pc.yellow(message)}`);
  },

  error(message: string, details?: unknown): void {
    console.error(`${pc.red('✖')} ${pc.red(message)}`);
    if (details) {
      console.error(details);
    }
  },

  step(step: string, message: string): void {
    console.log(`${pc.cyan(`[${step}]`)} ${message}`);
  },

  highlight(text: string): string {
    return pc.bold(pc.cyan(text));
  },

  dim(text: string): string {
    return pc.dim(text);
  },

  url(text: string): string {
    return pc.underline(pc.cyan(text));
  },
};