-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat(request): add flag to disable logging api warnings #925
Conversation
src/http/request.ts
Outdated
return getIt([ | ||
retry({shouldRetry}), | ||
...envMiddleware, | ||
printWarnings, | ||
printWarnings(config?.ignoreSanityAPIWarnings), |
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.
Another alternative here is to skip printWarnings
middleware if config.ignoreSanityAPIWarnings
flag is set. That makes printWarnings
middleware simpler.
How about making the setting: |
I guess that speaks to the intent of the flag. I'm thinking of this more as a log level filter. Since that isn't implemented, I opted for the existing pattern of an |
Agree with this - would be good to be able to opt out of particular warning(s), and still be able to get others. Guess that requires all warnings to be static strings (I suppose we don't have identifiers for these?), or allow providing a regex to match the warnings you want to ignore. Might also be worth to consider skipping warnings that has already been logged? |
When using the client library and the
vX
api, it can be undesirable/noisy to logfor every request.