Skip to content

Commit

Permalink
Merge pull request #8755 from elastic/jasper/backport/8746/5.0
Browse files Browse the repository at this point in the history
[backport] PR #8746 to 5.0
  • Loading branch information
kobelb authored Oct 19, 2016
2 parents 381cd82 + 11249b4 commit 4f2ba78
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/kibana
Original file line number Diff line number Diff line change
Expand Up @@ -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" ${@}
2 changes: 1 addition & 1 deletion bin/kibana-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -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" ${@}
2 changes: 1 addition & 1 deletion bin/kibana-plugin.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion bin/kibana.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/cli_plugin/install/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -18,6 +19,7 @@ function processCommand(command, options) {
}

const logger = new Logger(settings);
logWarnings(settings, logger);
install(settings, logger);
}

Expand Down
5 changes: 5 additions & 0 deletions src/cli_plugin/lib/log_warnings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function (settings, logger) {
process.on('warning', (warning) => {
logger.error(warning);
});
}
2 changes: 2 additions & 0 deletions src/cli_plugin/list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -14,6 +15,7 @@ function processCommand(command, options) {
}

const logger = new Logger(settings);
logWarnings(settings, logger);
list(settings, logger);
}

Expand Down
2 changes: 2 additions & 0 deletions src/cli_plugin/remove/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -15,6 +16,7 @@ function processCommand(command, options) {
}

const logger = new Logger(settings);
logWarnings(settings, logger);
remove(settings, logger);
}

Expand Down
1 change: 1 addition & 0 deletions src/server/kbn_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/server/warnings/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function (kbnServer, server, config) {
process.on('warning', (warning) => {
server.log(['warning', 'process'], warning);
});
}

0 comments on commit 4f2ba78

Please sign in to comment.