   end
 
   def refresh(feed) do
-    IO.puts "Refresh #{feed.title}"
+    Logger.info "Refresh feed id: #{feed.id}, title: #{feed.title}"
 
     {:ok, json_body}   = fetch(feed.feed_url)
     parsed_feed        = parse_feed(json_body)

defmodule WhistlerNewsReader.Fetcher do

  alias WhistlerNewsReader.Feed
  alias WhistlerNewsReader.Entry
  alias WhistlerNewsReader.Repo

  # def refresh_all do
  #   Enum.each(Repo.all(Feed), fn(feed) ->
  #     refresh(feed)
  #   end)
  # end

  def refresh_all(feeds) do
    Enum.each(feeds, fn(feed) ->

    }
  end

  # generate unique guid since in RSS/Atom entries the guid ist not always unique
  defp generate_guid(feed_url, entry_guid, entry_published, entry_title) do
    unique_id_str = "#{feed_url}#{entry_guid}#{entry_published}#{entry_title}"
    :crypto.hash(:sha256, unique_id_str) |> Base.encode16
