diff --git a/bin/http-server b/bin/http-server index 551b0ad9..ef6af541 100755 --- a/bin/http-server +++ b/bin/http-server @@ -59,14 +59,14 @@ if (!argv.s && !argv.silent) { if (error) { logger.info( '[%s] "%s %s" Error (%s): "%s"', - date, req.method.red, req.url.red, - error.status.toString().red, error.message.red + date, colors.red(req.method), colors.red(req.url), + colors.red(error.status.toString()), colors.red(error.message) ); } else { logger.info( '[%s] "%s %s" "%s"', - date, req.method.cyan, req.url.cyan, + date, colors.cyan(req.method), colors.cyan(req.url), req.headers['user-agent'] ); } @@ -123,20 +123,20 @@ function listen(port) { var canonicalHost = host === '0.0.0.0' ? '127.0.0.1' : host, protocol = ssl ? 'https://' : 'http://'; - logger.info(['Starting up http-server, serving '.yellow, - server.root.cyan, - ssl ? (' through'.yellow + ' https'.cyan) : '', - '\nAvailable on:'.yellow + logger.info([colors.yellow('Starting up http-server, serving '), + colors.cyan(server.root), + ssl ? (colors.yellow(' through') + colors.cyan(' https')) : '', + colors.yellow('\nAvailable on:') ].join('')); if (argv.a && host !== '0.0.0.0') { - logger.info((' ' + protocol + canonicalHost + ':' + port.toString()).green); + logger.info((' ' + protocol + canonicalHost + ':' + colors.green(port.toString()))); } else { Object.keys(ifaces).forEach(function (dev) { ifaces[dev].forEach(function (details) { if (details.family === 'IPv4') { - logger.info((' ' + protocol + details.address + ':' + port.toString()).green); + logger.info((' ' + protocol + details.address + ':' + colors.green(port.toString()))); } }); }); @@ -166,11 +166,11 @@ if (process.platform === 'win32') { } process.on('SIGINT', function () { - logger.info('http-server stopped.'.red); + logger.info(colors.red('http-server stopped.')); process.exit(); }); process.on('SIGTERM', function () { - logger.info('http-server stopped.'.red); + logger.info(colors.red('http-server stopped.')); process.exit(); });