       result)))
 
 (defn- process-output
-  [{:keys [verbose records output-folder file-name output-paths] :as context}]
+  [{:keys [verbose
+           records
+           output-folder
+           file-name
+           output-paths
+           progress-chan]
+    :as context}]
   (if (seq records)
     (let [output-path (format "%s/%s_%s.edn.gz"
                               output-folder
                               file-name
                               (count output-paths))]
-
-      (log/info "Writing" (count records) "records to" output-path)
-
       (binding [*print-meta* true]
         (with-open [writer (io/writer (GZIPOutputStream. (FileOutputStream. output-path)))]
           (.write writer (prn-str records))))
-
-      (log/info "Finished writing" output-path)
-
+      (>!! progress-chan [:output-path output-path])
       (-> context
           (assoc :records [])
           (update-in [:output-paths] #(conj % output-path))))

(defn- process-chunk-record
  "Processes a single record for the file chunking process"
  [{:keys [progress-chan] :as context} record]
  (>!! progress-chan record)
  (-> context
      (update-in [:records] #(conj % record))
      advance-context))

        progress-chan (chan)
        result (go
                 (with-open [input-stream (FileInputStream. input-file)]
                   (->> (read-source :gnucash input-stream)
                        (reduce process-chunk-record
                                {:output-paths []
                                 :verbose (-> opts :options :verbose)
                                 :records []
                                 :max-record-count (-> opts :options :maximum)
                                 :file-name (second (re-matches #"^(.+)(\..+)$" file-name))
                                 :output-folder output-folder
                                 :progress-chan progress-chan})
                        process-output)))]
    (go-loop [value (<! progress-chan)]
             (case (first value)
               :record
               (when (not (:verbose opts))
                 (print (-> value second meta :record-type name first))
                 (flush))
               :output-path
               (println "\n" (second value)))
             (recur (<! progress-chan)))
    (println "reading the source file...")
    (<!! result)
