rsnext/packages/next/build/output/log.ts
Shu Ding 1c1a4de0e2
Refactor base server to remove native dependencies (#33499)
Part of #31506, this PR removes `loadEnvConfig` and `chalk` from the base server while keeping the same behavior for the node server.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-01-20 21:25:44 +00:00

39 lines
963 B
TypeScript

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: string[]) {
console.log(prefixes.wait, ...message)
}
export function error(...message: string[]) {
console.error(prefixes.error, ...message)
}
export function warn(...message: string[]) {
console.warn(prefixes.warn, ...message)
}
export function ready(...message: string[]) {
console.log(prefixes.ready, ...message)
}
export function info(...message: string[]) {
console.log(prefixes.info, ...message)
}
export function event(...message: string[]) {
console.log(prefixes.event, ...message)
}
export function trace(...message: string[]) {
console.log(prefixes.trace, ...message)
}