Skip to content
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

fix: resolved issue in setLogger function with winston logger #1522

Merged
merged 4 commits into from
Jan 17, 2025

Conversation

abhilash-sivan
Copy link
Contributor

@abhilash-sivan abhilash-sivan commented Jan 17, 2025

refs INSTA-24448

refs #1521

@abhilash-sivan abhilash-sivan marked this pull request as ready for review January 17, 2025 15:21
@abhilash-sivan abhilash-sivan requested a review from a team as a code owner January 17, 2025 15:21
Copy link
Contributor

@kirrg001 kirrg001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-approving

@@ -174,6 +174,10 @@ function setLoggerLevel(_logger, level) {
*/
function isPinoLogger(_logger) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m still a bit concerned about this function. Would suggest revisiting this logic to ensure it accurately targets Pino logger without potentially matching other logging libraries that have similar properties.

typeof _logger === 'object' &&
typeof _logger.child === 'function' &&
typeof _logger.level === 'string' &&
typeof _logger.bindings === 'function'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bindings method is unique to Pino .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me still its too generic. Other logging libraries might also implement similar methods. Otherwise, if you’re confident that no other logger implements it in the same way as Pino, then it could be fine for now.

@abhilash-sivan abhilash-sivan merged commit 52f102e into main Jan 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants