diff options
Diffstat (limited to 'packages/create-turbo/src/logger.ts')
| -rw-r--r-- | packages/create-turbo/src/logger.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/packages/create-turbo/src/logger.ts b/packages/create-turbo/src/logger.ts new file mode 100644 index 0000000..ee6d584 --- /dev/null +++ b/packages/create-turbo/src/logger.ts @@ -0,0 +1,32 @@ +import chalk from "chalk"; +import ora from "ora"; +import gradient from "gradient-string"; + +const BLUE = "#0099F7"; +const RED = "#F11712"; +const YELLOW = "#FFFF00"; + +export const turboGradient = gradient(BLUE, RED); +export const turboBlue = chalk.hex(BLUE); +export const turboRed = chalk.hex(RED); +export const yellow = chalk.hex(YELLOW); + +export const turboLoader = (text: string) => + ora({ + text, + spinner: { + frames: [" ", turboBlue("> "), turboBlue(">> "), turboBlue(">>>")], + }, + }); + +export const info = (...args: any[]) => { + console.log(turboBlue.bold(">>>"), ...args); +}; + +export const error = (...args: any[]) => { + console.error(turboRed.bold(">>>"), ...args); +}; + +export const warn = (...args: any[]) => { + console.error(yellow.bold(">>>"), ...args); +}; |
