mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
// Check if colors should be disabled
|
|
const shouldDisableColors = !!process.env.METEOR_DISABLE_COLORS;
|
|
|
|
// ANSI color codes
|
|
const colors = {
|
|
reset: shouldDisableColors ? '' : '\x1b[0m',
|
|
blue: shouldDisableColors ? '' : '\x1b[34m',
|
|
red: shouldDisableColors ? '' : '\x1b[31m',
|
|
purple: shouldDisableColors ? '' : '\x1b[35m',
|
|
green: shouldDisableColors ? '' : '\x1b[32m'
|
|
};
|
|
|
|
/**
|
|
* Log a progress message in blue
|
|
* @param {string} message - The message to log
|
|
*/
|
|
export function logProgress(message) {
|
|
console.log(`${colors.blue}${message}${colors.reset}`);
|
|
}
|
|
|
|
/**
|
|
* Log an error message in red
|
|
* @param {string} message - The message to log
|
|
*/
|
|
export function logError(message) {
|
|
console.error(`${colors.red}${message}${colors.reset}`);
|
|
}
|
|
|
|
/**
|
|
* Log an info message in purple
|
|
* @param {string} message - The message to log
|
|
*/
|
|
export function logInfo(message) {
|
|
console.log(`${colors.purple}${message}${colors.reset}`);
|
|
}
|
|
|
|
/**
|
|
* Log a success message in green
|
|
* @param {string} message - The message to log
|
|
*/
|
|
export function logSuccess(message) {
|
|
console.log(`${colors.green}${message}${colors.reset}`);
|
|
}
|