-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
3
-
0
-
Not Needed
-
Not Needed
-
Use Case
As a... user using the Node Driver
I want... the logger to only be instantiated for components for which it is turned on, and want willLog checks to be quick
So that... the driver can not be slowed down if logging isn't turned on
User Impact
- This will make the driver performance less affected by the logger to users
Acceptance Criteria
Implementation Requirements
- Only instantiate the logger if all component severities are NOT set to 'off' after MongoLogger.resolveOptions(loggerEnvOptions, loggerClientOptions))
- Make MongoLogger variable optionally null in connection and topology class
- Precompute willLog (severity levels and components) so a mongoLogger getter can access them, quicker than willLog as function call
- in MongoLogger.turnOffSeverties(), set all precomputed willLog entries to false
Testing Requirements
- Unit test to check mongo logger is not instantiated if severity levels are set to 'off'
- Unit test new memoized WillLog (severity level and component) variable
- Ensure all existing tests pass