mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
a929b6a0f9
- matches logging in ignition: https://github.com/TryGhost/Ignition/blob/master/lib/logging/PrettyStream.js#L11 - so that it's possible to add log lines to our CLI tools that have a consistent format
33 lines
729 B
JavaScript
33 lines
729 B
JavaScript
const chalk = require('chalk');
|
|
const log = (...args) => console.log(...args); // eslint-disable-line no-console
|
|
|
|
module.exports.log = log;
|
|
|
|
module.exports.log.ok = (...args) => {
|
|
log(chalk.green('ok'), ...args);
|
|
};
|
|
|
|
module.exports.log.trace = (...args) => {
|
|
log(chalk.gray('trace'), ...args);
|
|
};
|
|
|
|
module.exports.log.debug = (...args) => {
|
|
log(chalk.gray('debug'), ...args);
|
|
};
|
|
|
|
module.exports.log.info = (...args) => {
|
|
log(chalk.cyan('info'), ...args);
|
|
};
|
|
|
|
module.exports.log.warn = (...args) => {
|
|
log(chalk.magenta('ok'), ...args);
|
|
};
|
|
|
|
module.exports.log.error = (...args) => {
|
|
log(chalk.red('error'), ...args);
|
|
};
|
|
|
|
module.exports.log.fatal = (...args) => {
|
|
log(chalk.inverse('fatal'), ...args);
|
|
};
|