🐛 Fix log level setting on file migrations ns

This commit is contained in:
Andrey Antukh 2023-09-01 13:55:23 +02:00
parent b7459726f5
commit 1e8226a3fc

View file

@ -12,7 +12,7 @@
[app.common.geom.shapes :as gsh] [app.common.geom.shapes :as gsh]
[app.common.geom.shapes.path :as gsp] [app.common.geom.shapes.path :as gsp]
[app.common.geom.shapes.text :as gsht] [app.common.geom.shapes.text :as gsht]
[app.common.logging :as log] [app.common.logging :as l]
[app.common.math :as mth] [app.common.math :as mth]
[app.common.pages :as cp] [app.common.pages :as cp]
[app.common.pages.helpers :as cph] [app.common.pages.helpers :as cph]
@ -25,7 +25,7 @@
(defmulti migrate :version) (defmulti migrate :version)
(log/set-level! :info) #?(:cljs (l/set-level! :info))
(defn migrate-data (defn migrate-data
([data] (migrate-data data cp/file-version)) ([data] (migrate-data data cp/file-version))
@ -33,7 +33,7 @@
(if (= (:version data) to-version) (if (= (:version data) to-version)
data data
(let [migrate-fn #(do (let [migrate-fn #(do
(log/trace :hint "migrate file" :id (:id %) :version-from %2 :version-to (inc %2)) (l/trc :hint "migrate file" :id (:id %) :version-from %2 :version-to (inc %2))
(migrate (assoc %1 :version (inc %2))))] (migrate (assoc %1 :version (inc %2))))]
(reduce migrate-fn data (range (:version data 0) to-version)))))) (reduce migrate-fn data (range (:version data 0) to-version))))))
@ -450,11 +450,11 @@
;; If we cannot find any we let the frame-id as it was before ;; If we cannot find any we let the frame-id as it was before
frame-id)] frame-id)]
(when (not= frame-id calculated-frame-id) (when (not= frame-id calculated-frame-id)
(log/info :hint "Fix wrong frame-id" (l/trc :hint "Fix wrong frame-id"
:shape (:name object) :shape (:name object)
:id (:id object) :id (:id object)
:current (dm/get-in objects [frame-id :name]) :current (dm/get-in objects [frame-id :name])
:calculated (get-in objects [calculated-frame-id :name]))) :calculated (get-in objects [calculated-frame-id :name])))
(assoc object :frame-id calculated-frame-id))) (assoc object :frame-id calculated-frame-id)))
(update-container [container] (update-container [container]