Skip to content

chore(electron): use logger instead of console.log#10209

Merged
andelf merged 1 commit intomasterfrom
chore/electron-console-log
Sep 13, 2023
Merged

chore(electron): use logger instead of console.log#10209
andelf merged 1 commit intomasterfrom
chore/electron-console-log

Conversation

@andelf
Copy link
Copy Markdown
Collaborator

@andelf andelf commented Sep 12, 2023

A log from a user without further info.

[2023-09-10 19:10:11.581] [debug] :electron.handler/watch-dir {:path "C:/Users/user/Documents/Logseq"}
[2023-09-10 19:10:12.369] [error] IPC error:  {:event #object[Object [object Object]], :args #js ["inflateGraphsInfo" #js [#js {:url "logseq_local_C:/Users/user/Documents/Logseq", :root "C:/Users/user/Documents/Logseq", :nfs? true}]]} Error:                                                                                      is not ISeqable
    at $cljs$core$seq$$ (C:\Users\user\AppData\Local\Logseq\app-0.9.17\resources\app\electron.js:1535:9)
    at $cljs$core$rest$$ (C:\Users\user\AppData\Local\Logseq\app-0.9.17\resources\app\electron.js:1548:356)
    at $cljs$core$next$$ (C:\Users\user\AppData\Local\Logseq\app-0.9.17\resources\app\electron.js:1552:290)
    at $cljs$core$second$$ (C:\Users\user\AppData\Local\Logseq\app-0.9.17\resources\app\electron.js:2039:29)
    at C:\Users\user\AppData\Local\Logseq\app-0.9.17\resources\app\electron.js:15367:301
    at C:\Users\user\AppData\Local\Logseq\app-0.9.17\resources\app\electron.js:15368:12
    at $JSCompiler_StaticMethods_sval$$ (C:\Users\user\AppData\Local\Logseq\app-0.9.17\resources\app\electron.js:3246:301)
    at $JSCompiler_prototypeAlias$$.$cljs$core$ISeqable$_seq$arity$1$ (C:\Users\user\AppData\Local\Logseq\app-0.9.17\resources\app\electron.js:3320:3)
    at $cljs$core$seq$$ (C:\Users\user\AppData\Local\Logseq\app-0.9.17\resources\app\electron.js:1524:40)
> npx source-map-cli resolve -c 10 electron.js.map 15367 301

Maps to electron/handler.cljs:254:27 (cljs.core/second)

          (reader/read-string sync-meta))))
    (catch :default e
      (js/console.debug "[read txid meta] #" root (.-message e)))))

(defmethod handle :inflateGraphsInfo [_win [_ graphs]]
  (if (seq graphs)
    (for [{:keys [root] :as graph} graphs]
      (if-let [sync-meta (read-txid-info! root)]
        (assoc graph
               :sync-meta sync-meta
               :GraphUUID (second sync-meta))
                           ^
        graph))
    []))

(defmethod handle :readGraphTxIdInfo [_win [_ root]]
  (read-txid-info! root))

(defn- get-graph-path
  [graph-name]
  (when graph-name
    (let [graph-name (sanitize-graph-name graph-name)

@github-actions github-actions bot added the :type/dev This label is used to indicate that an issue or PR is related to development tasks or changes that label Sep 12, 2023
Copy link
Copy Markdown
Collaborator

@logseq-cldwalker logseq-cldwalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andelf 👍 🚀

@andelf andelf merged commit 0f6266e into master Sep 13, 2023
@andelf andelf deleted the chore/electron-console-log branch September 13, 2023 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:type/dev This label is used to indicate that an issue or PR is related to development tasks or changes that

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants