adelevie / parse-ruby-client

A simple Ruby client for the parse.com REST API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Too Verbose

kurtisnelson opened this issue · comments

My tests end up with extra logs all over even though quiet is set to true.

I, [2015-01-28T11:05:01.784513 #39139]  INFO -- : Parse query for /1/classes/Drink {"where"=>"{\"objectId\":\"OvkpxtFVOz\"}"}
I, [2015-01-28T11:05:01.784987 #39139]  INFO -- : get https://api.parse.com/1/classes/Drink?where=%7B%22objectId%22%3A%22OvkpxtFVOz%22%7D
I, [2015-01-28T11:05:01.801498 #39139]  INFO -- Status: 200

Try passing quiet: true in Parse.init. See https://github.com/adelevie/parse-ruby-client#configuration.

Feel free to reopen if this is still a problem.

This is my initializer:

Parse.init :application_id => ENV['PARSE_ID'],
  :api_key        => ENV['PARSE_KEY'],
  :master_key     => ENV['PARSE_MASTER_KEY'],
  :quiet           => true

Not sure then. (reopening...)

Because quite config is in master only, not release yet. Here is the commit 618b551.

Bingo! If you want to use this feature now, change your gemfile to point to the master branch and run bundle exec ruby FILENAME.rb per #145

@adelevie I think you should release new version (say 0.4.0) with include this feature. As I see it's a importance feature and is in master for a long time

I think in the meantime, until the new version is released, you can reduce the logs by setting a new Logger in the initializer, and make it log only warnings or more severe messages:

    Parse.init application_id: 'APPLICATION_ID',
           api_key: 'API_KEY',
           logger: Logger.new(STDERR).tap { |logger| logger.level = Logger::WARN }

honestly, this is probably a better solution because my original fix silences all logging. Would love to get an elegant solution to passing in like, loud, quiet, silent for log level.