I am using the google-api-client
gem to interact with Google Calendar.
When saving a list of events like this:
@events = calendar.list_events(@tmpcalendar)
The output of calendar.list_events(@tmpcalendar)
is huge. I just want to save the result to @events
(don't need the huge content displayed).
I have tried: $output.close
, redirecting to /dev/null
, appending ;nil
; but the huge result is displayed anyway.
To replicate this (with a solution that works) you can
large_text = <<~EOS
...huge text here
...huge text here
...huge text here
...
...huge text here
EOS
eventos_good = large_text ; nil # Assigns the content, does not display it
eventos_annoying = large_text # Assigns the content, but displays the huge text
This works for that case, but does not work with the above scenario (API call).
Is it possible to avoid that huge output just for that variable assignment above?
Thanks.
According to the docs, the Google API gem has debug logging enabled by default. To decrease the output, set the logging level to something higher:
Google::Apis.logger.level = Logger::FATAL
# INFO, WARN, ERROR, FATAL each decrease the output.
# FATAL is the most restrictive.