refactor(lib): tidy doom-log output

This commit reduces the debug log noise, makes it easier to
read/parse/search, and soft-introduces a convention for doom-log
messages, where they are prefixed with a unique identifier loosely named
after it's running context or calling function.

I haven't enforced it everywhere doom-log is used yet, but this is a
start.
This commit is contained in:
Henrik Lissner 2022-09-11 20:12:22 +02:00
parent 0c43c769ef
commit 6cac7b05b6
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
8 changed files with 68 additions and 66 deletions

View file

@ -106,14 +106,14 @@ intervals."
(let ((req (pop packages))
idle-time)
(if (featurep req)
(doom-log "[ILoader] Already loaded: %s (%d left)" req (length packages))
(doom-log "start:iloader: Already loaded %s (%d left)" req (length packages))
(condition-case-unless-debug e
(and
(or (null (setq idle-time (current-idle-time)))
(< (float-time idle-time) doom-incremental-first-idle-timer)
(not
(while-no-input
(doom-log "[ILoader] Loading: %s (%d left)" req (length packages))
(doom-log "start:iloader: Loading %s (%d left)" req (length packages))
;; If `default-directory' doesn't exist or is
;; unreadable, Emacs throws file errors.
(let ((default-directory doom-emacs-dir)
@ -127,7 +127,7 @@ intervals."
(message "Error: failed to incrementally load %S because: %s" req e)
(setq packages nil)))
(if (null packages)
(doom-log "[ILoader] Finished!")
(doom-log "start:iloader: Finished!")
(run-at-time (if idle-time
doom-incremental-idle-timer
doom-incremental-first-idle-timer)