From aa6eb08b8ee857c4b27ebc888fac420414250257 Mon Sep 17 00:00:00 2001 From: Warren James Date: Mon, 23 Jan 2023 13:36:50 -0500 Subject: [PATCH 01/14] feat(NODE-4992): Start deprecating methods that reference legacy logger --- src/db.ts | 5 ++++- src/gridfs/download.ts | 2 ++ src/gridfs/index.ts | 4 +++- src/mongo_client.ts | 12 +++++++++--- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/db.ts b/src/db.ts index c6ab0bdc8d5..666df0cbf93 100644 --- a/src/db.ts +++ b/src/db.ts @@ -80,6 +80,7 @@ const DB_OPTIONS_ALLOW_LIST = [ export interface DbPrivate { client: MongoClient; options?: DbOptions; + /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ logger: Logger; readPreference?: ReadPreference; pkFactory: PkFactory; @@ -774,11 +775,13 @@ export class Db { return new ChangeStream(this, pipeline, resolveOptions(this, options)); } - /** Return the db logger */ + /** Return the db logger + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ getLogger(): Logger { return this.s.logger; } + /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ get logger(): Logger { return this.s.logger; } diff --git a/src/gridfs/download.ts b/src/gridfs/download.ts index 32946f67376..9cb2eba91e6 100644 --- a/src/gridfs/download.ts +++ b/src/gridfs/download.ts @@ -184,6 +184,8 @@ export class GridFSBucketReadStream extends Readable implements NodeJS.ReadableS * the 'close' event once the cursor is successfully killed. * * @param callback - called when the cursor is successfully closed or an error occurred. + * + * @deprecated GridFSBucketReadStream.abort is deprecated */ abort(callback?: Callback): void { this.push(null); diff --git a/src/gridfs/index.ts b/src/gridfs/index.ts index 874762b0132..5ab569419b4 100644 --- a/src/gridfs/index.ts +++ b/src/gridfs/index.ts @@ -226,7 +226,9 @@ export class GridFSBucket extends TypedEventEmitter { }, callback); } - /** Get the Db scoped logger. */ + /** Get the Db scoped logger. + * @deprecated Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance + */ getLogger(): Logger { return this.s.db.s.logger; } diff --git a/src/mongo_client.ts b/src/mongo_client.ts index 4d94d87747e..bbe9e08f1bb 100644 --- a/src/mongo_client.ts +++ b/src/mongo_client.ts @@ -233,9 +233,13 @@ export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeC * @deprecated Setting a custom promise library is deprecated the next major version will use the global Promise constructor only. */ promiseLibrary?: any; - /** The logging level */ + /** The logging level + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version + * */ loggerLevel?: LegacyLoggerLevel; - /** Custom logger object */ + /** Custom logger object + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version + */ logger?: LegacyLogger; /** Enable command monitoring for this client */ monitorCommands?: boolean; @@ -421,6 +425,7 @@ export class MongoClient extends TypedEventEmitter { return this.s.bsonOptions; } + /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ get logger(): LegacyLogger { return this.s.logger; } @@ -711,7 +716,8 @@ export class MongoClient extends TypedEventEmitter { return new ChangeStream(this, pipeline, resolveOptions(this, options)); } - /** Return the mongo client logger */ + /** Return the mongo client logger + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance*/ getLogger(): LegacyLogger { return this.s.logger; } From e6f7efb21653b74d478642fb4b63acd40c9e024d Mon Sep 17 00:00:00 2001 From: Warren James Date: Mon, 23 Jan 2023 14:05:38 -0500 Subject: [PATCH 02/14] style(NODE-4992): Change deprecation messages --- src/db.ts | 1 - src/gridfs/download.ts | 2 +- src/gridfs/index.ts | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/db.ts b/src/db.ts index 666df0cbf93..0f693a5ae8d 100644 --- a/src/db.ts +++ b/src/db.ts @@ -80,7 +80,6 @@ const DB_OPTIONS_ALLOW_LIST = [ export interface DbPrivate { client: MongoClient; options?: DbOptions; - /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ logger: Logger; readPreference?: ReadPreference; pkFactory: PkFactory; diff --git a/src/gridfs/download.ts b/src/gridfs/download.ts index 9cb2eba91e6..5ea89b56760 100644 --- a/src/gridfs/download.ts +++ b/src/gridfs/download.ts @@ -185,7 +185,7 @@ export class GridFSBucketReadStream extends Readable implements NodeJS.ReadableS * * @param callback - called when the cursor is successfully closed or an error occurred. * - * @deprecated GridFSBucketReadStream.abort is deprecated + * @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ abort(callback?: Callback): void { this.push(null); diff --git a/src/gridfs/index.ts b/src/gridfs/index.ts index 5ab569419b4..8d0d3197249 100644 --- a/src/gridfs/index.ts +++ b/src/gridfs/index.ts @@ -227,7 +227,7 @@ export class GridFSBucket extends TypedEventEmitter { } /** Get the Db scoped logger. - * @deprecated Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance + * @deprecated Legacy Logger is deprecated and will be removed in the next major version. */ getLogger(): Logger { return this.s.db.s.logger; From 33d38cf29b2d82e80bc5407160f9f40c79a79bc0 Mon Sep 17 00:00:00 2001 From: Warren James Date: Mon, 23 Jan 2023 14:09:51 -0500 Subject: [PATCH 03/14] style(NODE-4992): Update deprecation messages --- src/db.ts | 4 ++-- src/mongo_client.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/db.ts b/src/db.ts index 0f693a5ae8d..473a5a16e2c 100644 --- a/src/db.ts +++ b/src/db.ts @@ -775,12 +775,12 @@ export class Db { } /** Return the db logger - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ getLogger(): Logger { return this.s.logger; } - /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ + /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ get logger(): Logger { return this.s.logger; } diff --git a/src/mongo_client.ts b/src/mongo_client.ts index bbe9e08f1bb..49f35a38ab3 100644 --- a/src/mongo_client.ts +++ b/src/mongo_client.ts @@ -234,11 +234,11 @@ export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeC */ promiseLibrary?: any; /** The logging level - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. * */ loggerLevel?: LegacyLoggerLevel; /** Custom logger object - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. */ logger?: LegacyLogger; /** Enable command monitoring for this client */ @@ -425,7 +425,7 @@ export class MongoClient extends TypedEventEmitter { return this.s.bsonOptions; } - /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ + /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ get logger(): LegacyLogger { return this.s.logger; } @@ -436,7 +436,7 @@ export class MongoClient extends TypedEventEmitter { * @see docs.mongodb.org/manual/reference/connection-string/ */ connect(): Promise; - /** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ + /** @deprecated Callbacks are deprecated and will be removed in the next major version.*/ connect(callback: Callback): void; connect(callback?: Callback): Promise | void { if (callback && typeof callback !== 'function') { From 7b75675a9a8ce86794067dfb52557279ac1fd664 Mon Sep 17 00:00:00 2001 From: Warren James Date: Mon, 23 Jan 2023 14:15:15 -0500 Subject: [PATCH 04/14] fix(NODE-4992): Undo unintended comment change --- src/mongo_client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mongo_client.ts b/src/mongo_client.ts index 49f35a38ab3..2de309f2395 100644 --- a/src/mongo_client.ts +++ b/src/mongo_client.ts @@ -436,7 +436,7 @@ export class MongoClient extends TypedEventEmitter { * @see docs.mongodb.org/manual/reference/connection-string/ */ connect(): Promise; - /** @deprecated Callbacks are deprecated and will be removed in the next major version.*/ + /** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ connect(callback: Callback): void; connect(callback?: Callback): Promise | void { if (callback && typeof callback !== 'function') { From effa3bf646c424c03449cd22fee8981a6ce329ef Mon Sep 17 00:00:00 2001 From: Warren James Date: Mon, 23 Jan 2023 14:19:43 -0500 Subject: [PATCH 05/14] style(NODE-4992): Change message --- src/mongo_client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mongo_client.ts b/src/mongo_client.ts index 2de309f2395..29d9384312a 100644 --- a/src/mongo_client.ts +++ b/src/mongo_client.ts @@ -717,7 +717,7 @@ export class MongoClient extends TypedEventEmitter { } /** Return the mongo client logger - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance*/ + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ getLogger(): LegacyLogger { return this.s.logger; } From f5c0a01832530b97a6e4ad43d4debc6f883b2e08 Mon Sep 17 00:00:00 2001 From: Warren James Date: Mon, 23 Jan 2023 15:53:51 -0500 Subject: [PATCH 06/14] fix(NODE-4992): refactor GridFsBucketReadStream.abort to be promise only --- src/gridfs/download.ts | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/gridfs/download.ts b/src/gridfs/download.ts index 5ea89b56760..c186b69ad1c 100644 --- a/src/gridfs/download.ts +++ b/src/gridfs/download.ts @@ -12,7 +12,7 @@ import { import type { FindOptions } from '../operations/find'; import type { ReadPreference } from '../read_preference'; import type { Sort } from '../sort'; -import type { Callback } from '../utils'; +import { Callback, maybeCallback } from '../utils'; import type { GridFSChunk } from './upload'; /** @public */ @@ -187,22 +187,24 @@ export class GridFSBucketReadStream extends Readable implements NodeJS.ReadableS * * @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ - abort(callback?: Callback): void { - this.push(null); - this.destroyed = true; - if (this.s.cursor) { - this.s.cursor.close(error => { - this.emit(GridFSBucketReadStream.CLOSE); - callback && callback(error); - }); - } else { - if (!this.s.init) { - // If not initialized, fire close event because we will never - // get a cursor - this.emit(GridFSBucketReadStream.CLOSE); + abort(callback: Callback): void; + abort(callback?: Callback): Promise | void { + return maybeCallback(async () => { + this.push(null); + this.destroyed = true; + if (this.s.cursor) { + await this.s.cursor.close().catch(error => { + this.emit(GridFSBucketReadStream.CLOSE); + throw error; + }); + } else { + if (!this.s.init) { + // If not initialized, fire close event because we will never + // get a cursor + this.emit(GridFSBucketReadStream.CLOSE); + } } - callback && callback(); - } + }, callback); } } From 808022f65d3a02495f4a673585b689d09088cfaa Mon Sep 17 00:00:00 2001 From: Warren James Date: Mon, 23 Jan 2023 16:19:35 -0500 Subject: [PATCH 07/14] fix(NODE-4992): Add Promise only signature overload --- src/gridfs/download.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gridfs/download.ts b/src/gridfs/download.ts index c186b69ad1c..34620399c89 100644 --- a/src/gridfs/download.ts +++ b/src/gridfs/download.ts @@ -184,8 +184,9 @@ export class GridFSBucketReadStream extends Readable implements NodeJS.ReadableS * the 'close' event once the cursor is successfully killed. * * @param callback - called when the cursor is successfully closed or an error occurred. - * - * @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance + */ + abort(): Promise; + /** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ abort(callback: Callback): void; abort(callback?: Callback): Promise | void { From 61b8dc6e95fa742f02a88bdcb1fd42a9f8711cf7 Mon Sep 17 00:00:00 2001 From: Warren James Date: Mon, 23 Jan 2023 16:22:03 -0500 Subject: [PATCH 08/14] style(NODE-4992): Make deprecation message 1 line --- src/gridfs/download.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gridfs/download.ts b/src/gridfs/download.ts index 34620399c89..41a67d915d5 100644 --- a/src/gridfs/download.ts +++ b/src/gridfs/download.ts @@ -186,8 +186,7 @@ export class GridFSBucketReadStream extends Readable implements NodeJS.ReadableS * @param callback - called when the cursor is successfully closed or an error occurred. */ abort(): Promise; - /** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance - */ + /** @deprecated Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance */ abort(callback: Callback): void; abort(callback?: Callback): Promise | void { return maybeCallback(async () => { From 738181669717982fe61deea7c74af0d87199ed2c Mon Sep 17 00:00:00 2001 From: Warren James Date: Tue, 24 Jan 2023 15:16:36 -0500 Subject: [PATCH 09/14] fix(NODE-4992): Deprecate LoggerOptions, LoggerFunction, LoggerLevel --- src/logger.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/logger.ts b/src/logger.ts index ecbbe9cbfb7..17b93159d5b 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -15,7 +15,8 @@ const pid = process.pid; // eslint-disable-next-line no-console let currentLogger: LoggerFunction = console.warn; -/** @public */ +/** @public + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ export const LoggerLevel = Object.freeze({ ERROR: 'error', WARN: 'warn', @@ -27,13 +28,16 @@ export const LoggerLevel = Object.freeze({ debug: 'debug' } as const); -/** @public */ +/** @public + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ export type LoggerLevel = typeof LoggerLevel[keyof typeof LoggerLevel]; -/** @public */ +/** @public + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ export type LoggerFunction = (message?: any, ...optionalParams: any[]) => void; -/** @public */ +/** @public + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ export interface LoggerOptions { logger?: LoggerFunction; loggerLevel?: LoggerLevel; From f290d00c919b4d6cd49048a92617e2d396014b03 Mon Sep 17 00:00:00 2001 From: Warren James Date: Tue, 24 Jan 2023 15:20:51 -0500 Subject: [PATCH 10/14] style(NODE-4992): comment style --- src/logger.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/logger.ts b/src/logger.ts index 17b93159d5b..3615df28867 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -29,15 +29,18 @@ export const LoggerLevel = Object.freeze({ } as const); /** @public - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. + */ export type LoggerLevel = typeof LoggerLevel[keyof typeof LoggerLevel]; /** @public - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. + */ export type LoggerFunction = (message?: any, ...optionalParams: any[]) => void; /** @public - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. + */ export interface LoggerOptions { logger?: LoggerFunction; loggerLevel?: LoggerLevel; From 61c54959fcb3426c4a468d00ba259105697214dd Mon Sep 17 00:00:00 2001 From: Warren James Date: Tue, 24 Jan 2023 15:31:13 -0500 Subject: [PATCH 11/14] style(NODE-4992): tsdoc fixes --- src/db.ts | 5 +++-- src/gridfs/index.ts | 4 +++- src/logger.ts | 18 +++++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/db.ts b/src/db.ts index 473a5a16e2c..6ae478108b3 100644 --- a/src/db.ts +++ b/src/db.ts @@ -775,12 +775,13 @@ export class Db { } /** Return the db logger - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. + */ getLogger(): Logger { return this.s.logger; } - /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ + /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version. */ get logger(): Logger { return this.s.logger; } diff --git a/src/gridfs/index.ts b/src/gridfs/index.ts index 8d0d3197249..ef23fbef498 100644 --- a/src/gridfs/index.ts +++ b/src/gridfs/index.ts @@ -226,7 +226,9 @@ export class GridFSBucket extends TypedEventEmitter { }, callback); } - /** Get the Db scoped logger. + /** + * Get the Db scoped logger. + * * @deprecated Legacy Logger is deprecated and will be removed in the next major version. */ getLogger(): Logger { diff --git a/src/logger.ts b/src/logger.ts index 3615df28867..58683976362 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -15,7 +15,8 @@ const pid = process.pid; // eslint-disable-next-line no-console let currentLogger: LoggerFunction = console.warn; -/** @public +/** + * @public * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ export const LoggerLevel = Object.freeze({ ERROR: 'error', @@ -28,18 +29,21 @@ export const LoggerLevel = Object.freeze({ debug: 'debug' } as const); -/** @public - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. +/** + * @public + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. */ export type LoggerLevel = typeof LoggerLevel[keyof typeof LoggerLevel]; -/** @public - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. +/** + * @public + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. */ export type LoggerFunction = (message?: any, ...optionalParams: any[]) => void; -/** @public - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. +/** + * @public + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. */ export interface LoggerOptions { logger?: LoggerFunction; From 7e6ef066d7774ebbc0d9537809cf2120e2ad531b Mon Sep 17 00:00:00 2001 From: Warren James Date: Tue, 24 Jan 2023 15:33:51 -0500 Subject: [PATCH 12/14] style(NODE-4992): tsdoc fixes --- src/logger.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/logger.ts b/src/logger.ts index 58683976362..2e967f0fc32 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -17,7 +17,8 @@ let currentLogger: LoggerFunction = console.warn; /** * @public - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. + */ export const LoggerLevel = Object.freeze({ ERROR: 'error', WARN: 'warn', From 2dec8802f686c2574d1fa75d8aceaa7c423b8211 Mon Sep 17 00:00:00 2001 From: Warren James Date: Tue, 24 Jan 2023 15:38:12 -0500 Subject: [PATCH 13/14] style(NODE-4992): tsdoc fixes --- src/db.ts | 3 ++- src/mongo_client.ts | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/db.ts b/src/db.ts index 6ae478108b3..5e8d339c7b9 100644 --- a/src/db.ts +++ b/src/db.ts @@ -774,7 +774,8 @@ export class Db { return new ChangeStream(this, pipeline, resolveOptions(this, options)); } - /** Return the db logger + /** + * Return the db logger * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. */ getLogger(): Logger { diff --git a/src/mongo_client.ts b/src/mongo_client.ts index 29d9384312a..c15f12be717 100644 --- a/src/mongo_client.ts +++ b/src/mongo_client.ts @@ -233,11 +233,13 @@ export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeC * @deprecated Setting a custom promise library is deprecated the next major version will use the global Promise constructor only. */ promiseLibrary?: any; - /** The logging level + /** + * The logging level * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. - * */ + */ loggerLevel?: LegacyLoggerLevel; - /** Custom logger object + /** + * Custom logger object * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. */ logger?: LegacyLogger; @@ -425,7 +427,7 @@ export class MongoClient extends TypedEventEmitter { return this.s.bsonOptions; } - /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ + /** @deprecated The Legacy Logger is deprecated and will be removed in the next major version. */ get logger(): LegacyLogger { return this.s.logger; } @@ -716,8 +718,10 @@ export class MongoClient extends TypedEventEmitter { return new ChangeStream(this, pipeline, resolveOptions(this, options)); } - /** Return the mongo client logger - * @deprecated The Legacy Logger is deprecated and will be removed in the next major version.*/ + /** + * Return the mongo client logger + * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. + */ getLogger(): LegacyLogger { return this.s.logger; } From 8113bcee2ba15ad3327c3dd3cbfc5c7abcfdfa18 Mon Sep 17 00:00:00 2001 From: Warren James Date: Tue, 24 Jan 2023 17:12:05 -0500 Subject: [PATCH 14/14] style(NODE-4992): eslint --- src/mongo_client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mongo_client.ts b/src/mongo_client.ts index c15f12be717..77fc4953e1d 100644 --- a/src/mongo_client.ts +++ b/src/mongo_client.ts @@ -718,7 +718,7 @@ export class MongoClient extends TypedEventEmitter { return new ChangeStream(this, pipeline, resolveOptions(this, options)); } - /** + /** * Return the mongo client logger * @deprecated The Legacy Logger is deprecated and will be removed in the next major version. */