mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Core] Clean up excess logs (#171143)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
af32b980a4
commit
a37806a4f4
2 changed files with 0 additions and 20 deletions
|
@ -120,16 +120,6 @@ describe('UuidService', () => {
|
|||
});
|
||||
|
||||
describe('process warnings', () => {
|
||||
it('logs warnings coming from the process', async () => {
|
||||
await service.preboot({ analytics });
|
||||
|
||||
const warning = new Error('something went wrong');
|
||||
process.emit('warning', warning);
|
||||
|
||||
expect(logger.get('process').warn).toHaveBeenCalledTimes(1);
|
||||
expect(logger.get('process').warn).toHaveBeenCalledWith(warning);
|
||||
});
|
||||
|
||||
it('does not log deprecation warnings', async () => {
|
||||
await service.preboot({ analytics });
|
||||
|
||||
|
|
|
@ -46,13 +46,11 @@ export type InternalEnvironmentServiceSetup = InternalEnvironmentServicePreboot;
|
|||
/** @internal */
|
||||
export class EnvironmentService {
|
||||
private readonly log: Logger;
|
||||
private readonly processLogger: Logger;
|
||||
private readonly configService: IConfigService;
|
||||
private uuid: string = '';
|
||||
|
||||
constructor(core: CoreContext) {
|
||||
this.log = core.logger.get('environment');
|
||||
this.processLogger = core.logger.get('process');
|
||||
this.configService = core.configService;
|
||||
}
|
||||
|
||||
|
@ -71,14 +69,6 @@ export class EnvironmentService {
|
|||
this.log.warn(`Detected an unhandled Promise rejection: ${message}`);
|
||||
});
|
||||
|
||||
process.on('warning', (warning) => {
|
||||
// deprecation warnings do no reflect a current problem for the user and should be filtered out.
|
||||
if (warning.name === 'DeprecationWarning') {
|
||||
return;
|
||||
}
|
||||
this.processLogger.warn(warning);
|
||||
});
|
||||
|
||||
await createDataFolder({ pathConfig, logger: this.log });
|
||||
await writePidFile({ pidConfig, logger: this.log });
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue