fake-gcs-server icon indicating copy to clipboard operation
fake-gcs-server copied to clipboard

Ability to change log level

Open Meemaw opened this issue 2 years ago • 1 comments

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

Meemaw avatar Sep 25 '22 08:09 Meemaw

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

fsouza avatar Sep 25 '22 22:09 fsouza

@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.

RachitSharma2001 avatar Dec 25 '22 00:12 RachitSharma2001

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.

fsouza avatar Dec 28 '22 14:12 fsouza

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

RachitSharma2001 avatar Dec 28 '22 21:12 RachitSharma2001