   "Handle an http error during retrieval of URL with STATUS code."
   (cl-incf (elfeed-meta (elfeed-db-get-feed url) :failures 0))
   (run-hook-with-args 'elfeed-http-error-hooks url status)
-  (message "Elfeed fetch failed for %s: %S" url status))
+  (elfeed-log 'error "Elfeed fetch failed for %s: %S" url status))
 
 (defun elfeed-handle-parse-error (url error)
   "Handle parse error during parsing of URL with ERROR message."
   (cl-incf (elfeed-meta (elfeed-db-get-feed url) :failures 0))
   (run-hook-with-args 'elfeed-parse-error-hooks url error)
-  (message "Elfeed parse failed for %s: %s" url error))
+  (elfeed-log 'error "Elfeed parse failed for %s: %s" url error))
 
 (defun elfeed-update-feed (url)
   "Update a specific feed."

  (interactive)
  (let ((fails (mapcar #'url-queue-url elfeed-connections)))
    (when fails
      (message "Elfeed aborted feeds: %s" (mapconcat #'identity fails " ")))
    (setf url-queue nil))
  (elfeed-search-update :force))


  (elfeed-update-feed url)
  (elfeed-search-update :force))

(defun elfeed-log (level fmt &rest objects)
  (let ((log-buffer (get-buffer-create "*elfeed-log*")))
    (with-current-buffer log-buffer
      (goto-char (point-max))
      (insert (format "[%s] [%s]: %s\n"
                      (format-time-string "%Y-%m-%d %H:%M:%S")
                      level
                      (apply #'format fmt objects))))))

;;;###autoload
(defun elfeed-update ()
  "Update all the feeds in `elfeed-feeds'."
  (interactive)
  (elfeed-log 'info "Elfeed update: %s" (format-time-string "%B %e %Y %H:%M:%S %Z"))
  (mapc #'elfeed-update-feed (elfeed--shuffle (elfeed-feed-list)))
  (elfeed-search-update :force)
  (elfeed-db-save))
