2017-01-17 13:40:59 +01:00
|
|
|
/* eslint-disable no-console */
|
|
|
|
|
|
|
|
const chalk = require('chalk');
|
|
|
|
|
|
|
|
const divider = chalk.gray('\n-----------------------------------');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logger middleware, you can customize it to make messages more personal
|
|
|
|
*/
|
|
|
|
const logger = {
|
|
|
|
|
|
|
|
// Called whenever there's an error on the server we want to print
|
|
|
|
error: (err) => {
|
|
|
|
console.error(chalk.red(err));
|
|
|
|
},
|
|
|
|
|
|
|
|
// Called when express.js app starts on given port w/o errors
|
2017-05-10 14:39:00 +02:00
|
|
|
appStarted: (port) => {
|
2017-01-17 13:40:59 +01:00
|
|
|
|
|
|
|
console.log(`
|
2017-05-11 10:54:44 +02:00
|
|
|
Strapi plugin succesfully started in development mode. ${chalk.green('✓')}
|
|
|
|
${divider}
|
2017-09-29 14:56:29 +02:00
|
|
|
${chalk.bold('Access URL:')} ${chalk.magenta(`http://localhost:${port}${process.env.IS_ADMIN === 'true' ? '/admin' : '' }`)}${divider}
|
2017-01-17 13:40:59 +01:00
|
|
|
${chalk.blue(`Press ${chalk.italic('CTRL-C')} to stop`)}
|
|
|
|
`);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = logger;
|