diff options
author | Azul <azul@riseup.net> | 2013-09-25 12:29:48 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2013-09-25 12:29:48 +0200 |
commit | 377195ce83c22c3a3771565cf15f6a06f1440b06 (patch) | |
tree | a4a66c35162e4195c6c62defda2c306d1d56c4ce /lib/tapicero/couch_changes.rb | |
parent | 83c323fbe10249a54d6383189fd9279d82c7d010 (diff) |
log to file or syslog instead of STDOUT
Diffstat (limited to 'lib/tapicero/couch_changes.rb')
-rw-r--r-- | lib/tapicero/couch_changes.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/tapicero/couch_changes.rb b/lib/tapicero/couch_changes.rb index 55a5489..376eb11 100644 --- a/lib/tapicero/couch_changes.rb +++ b/lib/tapicero/couch_changes.rb @@ -21,8 +21,8 @@ module Tapicero end def listen - puts "listening..." - puts "Starting at sequence #{since}" + Tapicero.logger.info "listening..." + Tapicero.logger.debug "Starting at sequence #{since}" db.changes :feed => :continuous, :since => since, :heartbeat => 1000 do |hash| callbacks(hash) end @@ -44,13 +44,14 @@ module Tapicero end def read_seq(seq_filename) + Tapicero.logger.debug "Looking up sequence here: #{seq_filename}" FileUtils.touch(seq_filename) unless File.writable?(seq_filename) raise StandardError.new("Can't access sequence file") end @since = File.read(seq_filename) rescue Errno::ENOENT => e - puts "No sequence file found. Starting from scratch" + Tapicero.logger.warn "No sequence file found. Starting from scratch" end def store_seq(seq) @@ -62,7 +63,7 @@ module Tapicero # def fetch_last_seq hash = db.changes :limit => 1, :descending => true - puts "starting at seq: " + hash["last_seq"] + Tapicero.logger.info "starting at seq: " + hash["last_seq"] return hash["last_seq"] end |