log.rb is tested
basic function is okay, need to reorg