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

suppress http errors from log if not in debug mode #30

Closed
yahermann opened this issue May 1, 2020 · 1 comment
Closed

suppress http errors from log if not in debug mode #30

yahermann opened this issue May 1, 2020 · 1 comment

Comments

@yahermann
Copy link

It's very common to expect an http error in the course of "normal" (non-erroneous) operation. For example, we sometimes want to check if a resource exists, e.g. GET /some_resource/:id, and we expect to see an http 404 error if it doesn't.

We don't want to pollute the logs with this type of "normal" activity.

Suggested mod, starting in line 807 (https://metacpan.org/release/Web-API/source/lib/Web/API.pm, version 2.6):

if ($error) {
    chomp($error);
    $self->log("ERROR: $error");      #ADD:  if $self->debug;
    $answer->{error} = $error;
}
@yahermann yahermann changed the title Suppress http errors if not in debug mode Suppress http errors from log if not in debug mode May 1, 2020
@yahermann yahermann changed the title Suppress http errors from log if not in debug mode suppress http errors from log if not in debug mode May 1, 2020
@nupfel
Copy link
Owner

nupfel commented May 2, 2020

hi @yahermann, thanks for your interest in this project and submitting an issue!

I agree and changed the behaviour as suggested in the next version

@nupfel nupfel closed this as completed in 713df94 May 2, 2020
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

No branches or pull requests

2 participants