mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 19:28:12 +00:00
✨ Add minor enhacements to logging on frontend (#7401)
* ✨ Add logging consistency enhacements on fonts loading * ✨ Disable data evens ns logging * ✨ Simplify flags logging on application initialization * ✨ Improve features logging
This commit is contained in:
parent
cd9ba482e3
commit
7d16515eb7
@ -29,6 +29,7 @@
|
||||
[app.util.dom :as dom]
|
||||
[app.util.i18n :as i18n]
|
||||
[beicon.v2.core :as rx]
|
||||
[cuerdas.core :as str]
|
||||
[debug]
|
||||
[features]
|
||||
[potok.v2.core :as ptk]
|
||||
@ -42,8 +43,7 @@
|
||||
:asserts *assert*
|
||||
:build-date cf/build-date
|
||||
:public-uri (dm/str cf/public-uri))
|
||||
(doseq [flag cf/flags]
|
||||
(log/dbg :hint "flag enabled" :flag (name flag))))
|
||||
(log/inf :hint "enabled flags" :flags (str/join " " (map name cf/flags))))
|
||||
|
||||
(declare reinit)
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
[cuerdas.core :as str]
|
||||
[potok.v2.core :as ptk]))
|
||||
|
||||
(log/set-level! :trace)
|
||||
(log/set-level! :info)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Workspace Initialization
|
||||
@ -152,6 +152,9 @@
|
||||
|
||||
(defn- resolve-file
|
||||
[file]
|
||||
(log/inf :hint "resolve file"
|
||||
:file-id (str (:id file))
|
||||
:features (str/join " " (:features file)))
|
||||
(->> (fpmap/resolve-file file)
|
||||
(rx/map :data)
|
||||
(rx/map process-fills)
|
||||
|
||||
@ -125,5 +125,4 @@
|
||||
(wasm/initialize false))
|
||||
|
||||
(log/inf :hint "initialized"
|
||||
:enabled (str/join "," features)
|
||||
:runtime (str/join "," (:features-runtime state)))))))
|
||||
:enabled (str/join " " features))))))
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
[okulary.core :as l]
|
||||
[promesa.core :as p]))
|
||||
|
||||
(log/set-level! :info)
|
||||
(log/set-level! :debug)
|
||||
|
||||
(def google-fonts
|
||||
(preload-gfonts "fonts/gfonts.2025.05.19.json"))
|
||||
@ -121,11 +121,11 @@
|
||||
|
||||
(defmethod load-font :default
|
||||
[{:keys [backend] :as font}]
|
||||
(log/warn :msg "no implementation found for" :backend backend))
|
||||
(log/wrn :msg "no implementation found for" :backend backend))
|
||||
|
||||
(defmethod load-font :builtin
|
||||
[{:keys [id ::on-loaded] :as font}]
|
||||
(log/debug :hint "load-font" :font-id id :backend "builtin")
|
||||
(log/dbg :hint "load-font" :font-id id :backend "builtin")
|
||||
(when (fn? on-loaded)
|
||||
(on-loaded id)))
|
||||
|
||||
@ -157,7 +157,7 @@
|
||||
(defmethod load-font :google
|
||||
[{:keys [id ::on-loaded] :as font}]
|
||||
(when (exists? js/window)
|
||||
(log/info :hint "load-font" :font-id id :backend "google")
|
||||
(log/dbg :hint "load-font" :font-id id :backend "google")
|
||||
(let [url (generate-gfonts-url font)]
|
||||
(->> (fetch-gfont-css url)
|
||||
(rx/map process-gfont-css)
|
||||
@ -197,7 +197,7 @@
|
||||
(defmethod load-font :custom
|
||||
[{:keys [id ::on-loaded] :as font}]
|
||||
(when (exists? js/window)
|
||||
(log/info :hint "load-font" :font-id id :backend "custom")
|
||||
(log/dbg :hint "load-font" :font-id id :backend "custom")
|
||||
(let [css (generate-custom-font-css font)]
|
||||
(add-font-css! id css)
|
||||
(when (fn? on-loaded)
|
||||
@ -210,7 +210,7 @@
|
||||
(defn ensure-loaded!
|
||||
([font-id] (ensure-loaded! font-id nil))
|
||||
([font-id variant-id]
|
||||
(log/debug :action "try-ensure-loaded!" :font-id font-id :variant-id variant-id)
|
||||
(log/dbg :action "try-ensure-loaded!" :font-id font-id :variant-id variant-id)
|
||||
(if-not (exists? js/window)
|
||||
;; If we are in the worker environment, we just mark it as loaded
|
||||
;; without really loading it.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user