[GH-ISSUE #932] Ability to change log level #144

Closed
opened 2026-03-03 12:08:41 +03:00 by kerem · 4 comments
Owner

Originally created by @Meemaw on GitHub (Sep 25, 2022).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/932

By default, fake-gcs-server is quite spammy, doing info logging for every request.

Add an ability to change the log level to e.g warn/error

Originally created by @Meemaw on GitHub (Sep 25, 2022). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/932 By default, `fake-gcs-server` is quite spammy, doing info logging for every request. Add an ability to change the log level to e.g `warn/error`
kerem 2026-03-03 12:08:41 +03:00
Author
Owner

@fsouza commented on GitHub (Sep 25, 2022):

That sounds good to me. We can add a new flag (and eventually an environment variable when we solve #561).

<!-- gh-comment-id:1257292295 --> @fsouza commented on GitHub (Sep 25, 2022): That sounds good to me. We can add a new flag (and eventually an environment variable when we solve #561).
Author
Owner

@RachitSharma2001 commented on GitHub (Dec 25, 2022):

@fsouza @Meemaw I was wondering if I could pick this task up. My idea is to include a log-level flag which can be one of two options:

  1. info - log all http requests, warnings, and errors (basically everything)
  2. warn-error - log only warnings and errors
    Let me know what you think of this idea and if there is anything else I should change or add.
<!-- gh-comment-id:1364600975 --> @RachitSharma2001 commented on GitHub (Dec 25, 2022): @fsouza @Meemaw I was wondering if I could pick this task up. My idea is to include a `log-level` flag which can be one of two options: 1. info - log all http requests, warnings, and errors (basically everything) 2. warn-error - log only warnings and errors Let me know what you think of this idea and if there is anything else I should change or add.
Author
Owner

@fsouza commented on GitHub (Dec 28, 2022):

Hey @RachitSharma2001, I was thinking the flag would be a string and take anything that logrus accept. You could call ParseLevel and if that fails, you report an error to the user indicating invalid log level or something like that.

<!-- gh-comment-id:1366684783 --> @fsouza commented on GitHub (Dec 28, 2022): Hey @RachitSharma2001, I was thinking the flag would be a string and take anything that logrus accept. You could call [`ParseLevel`](https://pkg.go.dev/github.com/sirupsen/logrus#ParseLevel) and if that fails, you report an error to the user indicating invalid log level or something like that.
Author
Owner

@RachitSharma2001 commented on GitHub (Dec 28, 2022):

That sounds good! I have made a PR for this. Let me know if there is anything that should be changed or added.

<!-- gh-comment-id:1366920662 --> @RachitSharma2001 commented on GitHub (Dec 28, 2022): That sounds good! I have made a PR for this. Let me know if there is anything that should be changed or added.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#144
No description provided.