diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-06-20 08:41:40 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-06-20 08:41:40 +0100 |
commit | eb9595e6603580a0ba413379b4cb133cba80a4a3 (patch) | |
tree | 4c60b1b4b99e5c10ac25d655b630e894f2ed49bb | |
parent | 91f55f1102134ff3d8ef1c7c4d367d8512d7e54d (diff) |
Use explicit `Rails.logger` (as we're not inheriting from ActiveRecord)
-rw-r--r-- | lib/quiet_opener.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/quiet_opener.rb b/lib/quiet_opener.rb index a077ca323..11adfe402 100644 --- a/lib/quiet_opener.rb +++ b/lib/quiet_opener.rb @@ -5,7 +5,7 @@ def quietly_try_to_open(url) begin result = open(url).read.strip rescue OpenURI::HTTPError, SocketError, Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH - logger.warn("Unable to open third-party URL #{url}") + Rails.logger.warn("Unable to open third-party URL #{url}") result = "" end return result @@ -22,12 +22,12 @@ def quietly_try_to_purge(host, url) result_body = response.body } rescue OpenURI::HTTPError, SocketError, Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH - logger.warn("Unable to reach host #{host}") + Rails.logger.warn("Unable to reach host #{host}") end if result == "200" - logger.info("Purged URL #{url} at #{host}: #{result}") + Rails.logger.info("Purged URL #{url} at #{host}: #{result}") else - logger.warn("Unable to purge URL #{url} at #{host}: status #{result}") + Rails.logger.warn("Unable to purge URL #{url} at #{host}: status #{result}") end return result end |