-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(NODE-4686): Add log messages to CLAM #3955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6d32c32
rebased changes
aditi-khare-mongoDB 5f5d77e
All tests passing, need to add in prose tests
aditi-khare-mongoDB 209ba27
Added prose tests
aditi-khare-mongoDB 3bee17a
Added forgotten edge case
aditi-khare-mongoDB fcfc98b
removed stray only
aditi-khare-mongoDB 422c6a9
workaround for messy messy rebase
aditi-khare-mongoDB c360ec2
refixed connection.ts, tests passing again
aditi-khare-mongoDB 054094f
PR requested changes
aditi-khare-mongoDB 0d8d051
Error fix
aditi-khare-mongoDB 383f890
use hello not serverConnectionId to ensure support for versions below…
aditi-khare-mongoDB 7033dc8
test versioning fix and package.lock fix
aditi-khare-mongoDB 1d70579
Merge branch 'main' into NODE-4686/CLAM-logging-with-serverConnectionid
durran 0ae8792
test fix
aditi-khare-mongoDB e92849d
versioning fix
aditi-khare-mongoDB 9776ec9
PR requested changes, all tests passing
aditi-khare-mongoDB 3332f94
extraneous .only removal
aditi-khare-mongoDB cacaed2
Update src/mongo_logger.ts
aditi-khare-mongoDB fa223cf
lint fix
aditi-khare-mongoDB 299e8a1
neal's pr requested changes
aditi-khare-mongoDB 1181991
pr again
aditi-khare-mongoDB 8f6c860
pr requested changes again
aditi-khare-mongoDB dc93151
pr requested changes 4
aditi-khare-mongoDB cbb5df6
bailey's pr requested changes
aditi-khare-mongoDB 9ace7a0
reauth support for connection.established
aditi-khare-mongoDB e9d4f8d
lint fix
aditi-khare-mongoDB 7892601
added getter and using authContext?.authenticating directly
aditi-khare-mongoDB 3c18428
Merge branch 'main' into NODE-4686/CLAM-logging-with-serverConnectionid
durran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting idea - I see it's used in TypedEventEmitter to know which logging component to use.
Will there ever be a case where
emitAndLogCommand
will be used to log for a component that is notMongoLoggableComponent.COMMAND
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there won't. The extra
this.component
check should ensure that anemitAndLog
or variant function (emitAndLogCommand, emitAndLogHeartbeat
) is not called from any class for which the logging component is not defined already.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add in an extra check such as:
this.component === MongoLoggableComponent.COMMAND
, remove thethis.component
check foremitAndLogCommand
, or keep it the same. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's strange to me that we have a dedicated method for logging commands, but to use it we also need to set the component on the class. I would expect that either:
emitAndLogCommand()
, and not thecomponent
property.emitAndLog()
method that uses thecomponent
property and no specialized methods on the TypedEventEmitterIf we want to prevent the emitAndLog functions from being called, maybe we could use inheritance for this? that way we could only define the log methods where they can be used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. For the sake of this PR, I'll just hardcode in the component in
emitAndLogCommand
asMongoLoggableComponent.COMMAND.
Since I realizeemitAndLogCommand
already implies that the command component is being utilized.