expose LoggingService to legacy platform (#36376) (#36650)

This commit is contained in:
Mikhail Shustov 2019-05-18 15:14:12 -04:00 committed by GitHub
parent c1d86327d0
commit 8e82d58b0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 1 deletions

View file

@ -188,6 +188,7 @@ describe('once LegacyService is set up with connection info', () => {
someOption: 'foo',
},
handledConfigPaths: ['foo.bar'],
logger,
}
);
@ -214,6 +215,7 @@ describe('once LegacyService is set up with connection info', () => {
someOption: 'foo',
},
handledConfigPaths: ['foo.bar'],
logger,
}
);
@ -340,6 +342,7 @@ describe('once LegacyService is set up without connection info', () => {
startDeps: disabledHttpStartDeps,
serverOptions: { autoListen: false },
handledConfigPaths: ['foo.bar'],
logger,
}
);
});

View file

@ -148,6 +148,7 @@ export class LegacyService implements CoreService {
handledConfigPaths: await this.coreContext.configService.getUsedPaths(),
setupDeps,
startDeps,
logger: this.coreContext.logger,
});
// The kbnWorkerType check is necessary to prevent the repl

View file

@ -24,6 +24,7 @@ import {
HttpServiceSetup,
HttpServiceStart,
ConfigService,
LoggerFactory,
PluginsServiceSetup,
PluginsServiceStart,
} from '../../core/server';
@ -88,6 +89,9 @@ type Unpromise<T> = T extends Promise<infer U> ? U : T;
// eslint-disable-next-line import/no-default-export
export default class KbnServer {
public readonly newPlatform: {
coreContext: {
logger: LoggerFactory;
};
setup: {
core: {
elasticsearch: ElasticsearchServiceSetup;

View file

@ -55,8 +55,11 @@ export default class KbnServer {
this.rootDir = rootDir;
this.settings = settings || {};
const { setupDeps, startDeps, serverOptions, handledConfigPaths } = core;
const { setupDeps, startDeps, serverOptions, handledConfigPaths, logger } = core;
this.newPlatform = {
coreContext: {
logger,
},
setup: {
core: {
elasticsearch: setupDeps.elasticsearch,