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

Ability to change log level #932

Closed
Meemaw opened this issue Sep 25, 2022 · 4 comments
Closed

Ability to change log level #932

Meemaw opened this issue Sep 25, 2022 · 4 comments

Comments

@Meemaw
Copy link

Meemaw commented Sep 25, 2022

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

@fsouza
Copy link
Owner

fsouza commented Sep 25, 2022

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

@RachitSharma2001
Copy link
Contributor

RachitSharma2001 commented 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.

@fsouza
Copy link
Owner

fsouza commented 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.

@RachitSharma2001
Copy link
Contributor

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

@fsouza fsouza closed this as completed Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants