Files
metabuilder/dbal/shared/tools/cpp-build-assistant/logging.ts

19 lines
673 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export const COLORS = {
reset: '\x1b[0m',
bright: '\x1b[1m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
blue: '\x1b[34m',
magenta: '\x1b[35m',
cyan: '\x1b[36m',
} as const
export const log = {
info: (msg: string) => console.log(`${COLORS.blue}${COLORS.reset} ${msg}`),
success: (msg: string) => console.log(`${COLORS.green}${COLORS.reset} ${msg}`),
warn: (msg: string) => console.log(`${COLORS.yellow}${COLORS.reset} ${msg}`),
error: (msg: string) => console.log(`${COLORS.red}${COLORS.reset} ${msg}`),
section: (msg: string) => console.log(`\n${COLORS.bright}${COLORS.cyan}${msg}${COLORS.reset}\n`),
}