Show
Ignore:
Timestamp:
08/29/08 21:22:04 (4 months ago)
Author:
whym
Message:

add logger

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/echola/hatenahaiku-download.rb

    r18100 r18438  
    66require 'yaml' 
    77require 'mycabinet' 
     8require 'logger' 
    89 
     10$logger = Logger.new "#{here}/hatenahaiku-download.log" 
    911source = ARGV[0] || 'http://h.hatena.ne.jp/api/statuses/public_timeline.json' 
    1012dbfile = ARGV[1] || "#{here}/hatenahaiku-public.db" 
     
    1416  dbtype = MyCabinet::HDB 
    1517  dbtype.new.open(dbfile, dbtype::OWRITER | dbtype::OCREAT | dbtype::ONOLCK) do |db| 
     18    $logger.info "writing entries between #{content[0]['created_at']} and #{content[-1]['created_at']} ..." 
    1619    content.each do |item| 
    1720      db.putasync(item.id.to_s, item.to_yaml)