スクリプトの時刻付きログ出力メソッド

log_pathにlog_textを出力。
なおMac OS Xでのローカルユーザのlogファイルは ~/Library/Logs/ に置かれます。

def log_with_time(log_path, log_text)
  open(File.expand_path(log_path), "a+") do |f|
    f.puts Time.now.strftime("%Y-%m-%d %H:%M:%S") + " " + log_text
  end
end

モードは多分"a+"なのではないかと。