Merge pull request #8755 from elastic/jasper/backport/8746/5.0

[backport] PR #8746 to 5.0
This commit is contained in:
Brandon Kobel 2016-10-19 15:10:21 -04:00 committed by GitHub
commit 4f2ba78a11
10 changed files with 21 additions and 4 deletions

View file

@ -21,4 +21,4 @@ if [ ! -x "$NODE" ]; then
exit 1
fi
exec "${NODE}" $NODE_OPTIONS "${DIR}/src/cli" ${@}
exec "${NODE}" $NODE_OPTIONS --no-warnings "${DIR}/src/cli" ${@}

View file

@ -21,4 +21,4 @@ if [ ! -x "$NODE" ]; then
exit 1
fi
exec "${NODE}" $NODE_OPTIONS "${DIR}/src/cli_plugin" ${@}
exec "${NODE}" $NODE_OPTIONS --no-warnings "${DIR}/src/cli_plugin" ${@}

View file

@ -22,7 +22,7 @@ If Not Exist "%NODE%" (
)
TITLE Kibana Server
"%NODE%" %NODE_OPTIONS% "%DIR%\src\cli_plugin" %*
"%NODE%" %NODE_OPTIONS% --no-warnings "%DIR%\src\cli_plugin" %*
:finally

View file

@ -22,7 +22,7 @@ If Not Exist "%NODE%" (
)
TITLE Kibana Server
"%NODE%" %NODE_OPTIONS% "%DIR%\src\cli" %*
"%NODE%" %NODE_OPTIONS% --no-warnings "%DIR%\src\cli" %*
:finally

View file

@ -6,6 +6,7 @@ import pkg from '../../utils/package_json';
import { getConfig } from '../../server/path';
import { parse, parseMilliseconds } from './settings';
import { find } from 'lodash';
import logWarnings from '../lib/log_warnings';
function processCommand(command, options) {
let settings;
@ -18,6 +19,7 @@ function processCommand(command, options) {
}
const logger = new Logger(settings);
logWarnings(settings, logger);
install(settings, logger);
}

View file

@ -0,0 +1,5 @@
export default function (settings, logger) {
process.on('warning', (warning) => {
logger.error(warning);
});
}

View file

@ -2,6 +2,7 @@ import { fromRoot } from '../../utils';
import list from './list';
import Logger from '../lib/logger';
import { parse } from './settings';
import logWarnings from '../lib/log_warnings';
function processCommand(command, options) {
let settings;
@ -14,6 +15,7 @@ function processCommand(command, options) {
}
const logger = new Logger(settings);
logWarnings(settings, logger);
list(settings, logger);
}

View file

@ -3,6 +3,7 @@ import remove from './remove';
import Logger from '../lib/logger';
import { parse } from './settings';
import { getConfig } from '../../server/path';
import logWarnings from '../lib/log_warnings';
function processCommand(command, options) {
let settings;
@ -15,6 +16,7 @@ function processCommand(command, options) {
}
const logger = new Logger(settings);
logWarnings(settings, logger);
remove(settings, logger);
}

View file

@ -19,6 +19,7 @@ module.exports = class KbnServer {
require('./config/setup'), // sets this.config, reads this.settings
require('./http'), // sets this.server
require('./logging'),
require('./warnings'),
require('./status'),
// writes pid file

View file

@ -0,0 +1,5 @@
export default function (kbnServer, server, config) {
process.on('warning', (warning) => {
server.log(['warning', 'process'], warning);
});
}