chore(apps/server)!: rewrite rename and move to appropriate dir

This commit is contained in:
PalmDevs
2023-11-24 23:06:57 +07:00
parent ab44312e7b
commit c97ba54802
22 changed files with 1588 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import { Chalk } from 'chalk'
const chalk = new Chalk()
const logger = {
debug: (...args) => console.debug(chalk.gray('DEBUG:', ...args)),
info: (...args) => console.info(chalk.bgBlue.whiteBright(' INFO '), ...args),
warn: (...args) => console.warn(chalk.bgYellow.blackBright.bold(' WARN '), chalk.yellowBright(...args)),
error: (...args) => console.error(chalk.bgRed.whiteBright.bold(' ERROR '), chalk.redBright(...args)),
log: console.log,
} satisfies Logger
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'log'
export type LogFunction = (...x: any[]) => void
export type Logger = Record<LogLevel, LogFunction>
export default logger