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

@ -13,9 +13,11 @@ debug mode is off."
(let ((inhibit-message (not init-file-debug)))
(message
"%s" (propertize
(format (concat "* [%.06f] " ,output)
(float-time (time-subtract (current-time) before-init-time))
,@args)
;; Byte compiler: don't complain about more args than %-sequences.
(with-no-warnings
(format (concat "* %.06f: " ,output)
(float-time (time-subtract (current-time) before-init-time))
,@args))
'face 'font-lock-doc-face)))))
@ -115,7 +117,7 @@ at the values with which this function was called."
"Load PATH and handle any Doom errors that arise from it.
If NOERROR, don't throw an error if PATH doesn't exist."
(doom-log "Loading %S..." path)
(doom-log "load: %s %s" (abbreviate-file-name path) noerror)
(condition-case-unless-debug e
(load path noerror 'nomessage)
((doom-error file-missing)