google-drive-ruby
google-drive-ruby copied to clipboard
Decrease output into ruby logs
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.
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