logger's exception handling, monkeypatching must be explicitly enabled.
Otherwise cucumber's cleanup on uncaught exceptions in features/support/env.js doesn't get called.
This commit is contained in:
Родитель
42092e6a78
Коммит
5ddf6ad175
|
@ -1,12 +1,16 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
var validatorService = require('../');
|
||||
|
||||
validatorService.logger.init();
|
||||
|
||||
if ( process.env.NEW_RELIC_HOME ) {
|
||||
require( 'newrelic' );
|
||||
}
|
||||
|
||||
const PORT = process.env['PORT'] || 8888;
|
||||
|
||||
var app = require('../').app.build();
|
||||
var app = validatorService.app.build();
|
||||
app.listen(PORT, function() {
|
||||
console.log("Listening on port " + PORT + ".");
|
||||
});
|
|
@ -46,16 +46,18 @@ log.middleware = function middleware() {
|
|||
};
|
||||
};
|
||||
|
||||
// Ensure uncaught exceptions end up in the event stream too
|
||||
process.once('uncaughtException', function (err) {
|
||||
log.fatal(err);
|
||||
throw err;
|
||||
});
|
||||
log.init = function init() {
|
||||
// Ensure uncaught exceptions end up in the event stream too
|
||||
process.once('uncaughtException', function (err) {
|
||||
log.fatal(err);
|
||||
throw err;
|
||||
});
|
||||
|
||||
// Patch console so it only outputs to stderr
|
||||
console.log = function() {
|
||||
process.stderr.write(util.format.apply(this, arguments) + '\n');
|
||||
// Patch console so it only outputs to stderr
|
||||
console.log = function() {
|
||||
process.stderr.write(util.format.apply(this, arguments) + '\n');
|
||||
};
|
||||
console.dir = function(object) {
|
||||
process.stderr.write(util.inspect(object) + '\n');
|
||||
};
|
||||
};
|
||||
console.dir = function(object) {
|
||||
process.stderr.write(util.inspect(object) + '\n');
|
||||
};
|
Загрузка…
Ссылка в новой задаче