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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add option quietResLogger to supress response data from res.log entries #256

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

micalevisk
Copy link

closes #235

I didn't succeeded on making the npm t running with no errors, even in the fresh new cloned repo 馃

@micalevisk micalevisk marked this pull request as draft November 14, 2022 20:43
@micalevisk micalevisk marked this pull request as ready for review November 14, 2022 23:23
@micalevisk micalevisk marked this pull request as draft November 15, 2022 00:04
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

can you add the docs to the README?

@micalevisk
Copy link
Author

micalevisk commented Nov 15, 2022

Done @mcollina

This is marked as a draft because I'm not confident on the changes I've made yet since the tests aren't running :/

Actually, I believe that there is something wrong here. I'm still trying to implement this feature.

@mcollina
Copy link
Member

What errors are you getting?

let fullReqLogger = reqLog.child({ [reqKey]: req })

const resLog = quietResLogger ? logger.child({ [requestIdKey]: req.id }) : logger
let fullResLogger = resLog.child({ [resKey]: res })
Copy link
Author

Choose a reason for hiding this comment

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

What errors are you getting?

@mcollina a bunch of tests stop passing after adding this line

Copy link
Member

Choose a reason for hiding this comment

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

The tests should be updated

Choose a reason for hiding this comment

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

could we not do this?

const log = quietReqLogger  || quietResLogger ? logger.child({ [requestIdKey]: req.id }) : logger

and leave the rest of the code as is?

Copy link
Author

Choose a reason for hiding this comment

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

hm, I just did it but the tests are still not passing

image

Choose a reason for hiding this comment

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

I actually really want this feature, I'll pull tomorrow and use some work time on it

@vorticalbox
Copy link

vorticalbox commented Nov 25, 2022

actually the misunderstood the ticket, I wanted a way to disable the request complete log. have a PR here #259

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants