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

Decrease output into ruby logs #440

Open
ldanielw1 opened this issue Sep 17, 2024 · 1 comment
Open

Decrease output into ruby logs #440

ldanielw1 opened this issue Sep 17, 2024 · 1 comment

Comments

@ldanielw1
Copy link

Is there a way to not output the API call outputs into the ruby logs unless some verbose flag is on? I love this gem, but it's making it hard to read my current ruby logs when I keep calling Drive APIs.

@mario-amazing
Copy link

mario-amazing commented Dec 10, 2024

You can use this workaround in config/environments/development.rb:

Google::Apis.logger.formatter = proc do |severity, datetime, progname, msg|
  msg.is_a?(String) && msg.match?(/(HTTP::Message::Body:)|(Success - )/) ? nil : Rails.logger.formatter.call(severity, datetime, progname, msg)
end
Google::Apis.logger.level = Logger::DEBUG

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