Skip to content

Commit 9044127

Browse files
Essentially ready for PR
1 parent 6fc01b1 commit 9044127

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

src/connection_string.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,8 +1224,11 @@ export const OPTIONS = {
12241224
'useUnifiedTopology has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version'
12251225
} as OptionDescriptor,
12261226
// MongoLogger
1227-
// TODO(NODE-4849): Tighten the type of mongodbLogPath
1228-
mongodbLogPath: { type: 'any' }
1227+
/**
1228+
* @internal
1229+
* TODO: NODE-5671 - remove internal flag
1230+
*/
1231+
mongoLoggerClientOptions: { type: 'any' }
12291232
} as Record<keyof MongoClientOptions, OptionDescriptor>;
12301233

12311234
export const DEFAULT_OPTIONS = new CaseInsensitiveMap(

src/mongo_client.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ import { MONGO_CLIENT_EVENTS } from './constants';
2121
import { Db, type DbOptions } from './db';
2222
import type { Encrypter } from './encrypter';
2323
import { MongoInvalidArgumentError } from './error';
24-
import { MongoLogger, type MongoLoggerOptions } from './mongo_logger';
24+
import {
25+
MongoLogger,
26+
type MongoLoggerMongoClientOptions,
27+
type MongoLoggerOptions
28+
} from './mongo_logger';
2529
import { TypedEventEmitter } from './mongo_types';
2630
import { executeOperation } from './operations/execute_operation';
2731
import { RunAdminCommandOperation } from './operations/run_command';
@@ -252,6 +256,11 @@ export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeC
252256
srvPoller?: SrvPoller;
253257
/** @internal */
254258
connectionType?: typeof Connection;
259+
/**
260+
* @internal
261+
* TODO: NODE-5671 - remove internal flag
262+
*/
263+
mongoLoggerClientOptions?: MongoLoggerMongoClientOptions;
255264

256265
/** @internal */
257266
[featureFlag: symbol]: any;
@@ -825,6 +834,14 @@ export interface MongoOptions
825834
/** @internal */
826835
[featureFlag: symbol]: any;
827836

828-
/** @internal */
837+
/**
838+
* @internal
839+
* TODO: NODE-5671 - remove internal flag
840+
*/
829841
mongoLoggerOptions: MongoLoggerOptions;
842+
/**
843+
* @internal
844+
* TODO: NODE-5671 - remove internal flag
845+
*/
846+
mongoLoggerClientOptions?: MongoLoggerMongoClientOptions;
830847
}

src/mongo_logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export function createStdioLogger(stream: {
191191
*/
192192
function resolveLogPath(
193193
{ MONGODB_LOG_PATH }: MongoLoggerEnvOptions,
194-
{ mongodbLogPath }: { mongodbLogPath?: string | Writable | MongoDBLogWritable }
194+
{ mongodbLogPath }: MongoLoggerMongoClientOptions
195195
): MongoDBLogWritable {
196196
if (typeof mongodbLogPath === 'string' && /^stderr$/i.test(mongodbLogPath)) {
197197
return createStdioLogger(process.stderr);

test/tools/unified-spec-runner/entities.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ export class UnifiedMongoClient extends MongoClient {
189189
[Symbol.for('@@mdb.skipPingOnConnect')]: true,
190190
[Symbol.for('@@mdb.enableMongoLogger')]: true,
191191
[Symbol.for('@@mdb.internalLoggerConfig')]: componentSeverities,
192-
// @ts-expect-error TODO(NODE-4849): Remove this once we have support for mongodbLogPath
193-
mongodbLogPath: logCollector,
194192
...getEnvironmentalOptions(),
195193
...(description.serverApi ? { serverApi: description.serverApi } : {})
196194
} as any);

0 commit comments

Comments
 (0)