amco / dolly

Not an ORM for CouchDB in rails.
8 stars 3 forks source link

add a logger for queries #130

Closed seancookr closed 7 years ago

seancookr commented 7 years ago

This was requested to allow for easier debugging in development

javierg commented 7 years ago

:+1:

seancookr commented 7 years ago

As I keep working on this, I think this is the perfect time to include some configuration work. Right now it is just to turn on and off the switch for logging requests. For instance, in a rails initializer you could do the following:

#config/initializers/dolly.rb

Dolly.configure do |dolly|
  dolly.log_requests = Rails.env.development?
end

To allow for only logging in development. Or what have you.

Over all I feel that this is a small config option, and it make sense now to include a configuration object. As we migrate Dolly to be more configurable, this provides a foundation to start from.

norcal82 commented 7 years ago

🎉 looks good. has my :shipit: and I agree that tuning the log levels in another PR is a good next step.

javierg commented 7 years ago

:shipit: