refactor(cli,lib): print levels & output redirection

This refactors how Doom captures and redirects its output (to stdout and
stderr) into a more general with-output-to! macro, and:

- Simplifies the "print level" system. The various doom-print-*-level
  variables have been removed.
- Adds a new print level: notice, which will be the default level for
  all standard output (from print!, doom-print, prin[ct1], etc).
- Adds a with-output-to! macro for capturing and redirecting
  output to multiple streams (without suppressing it from stdout). It
  can also be nested.
- Changes the following about doom-print:
  - Default :format changed to nil (was t)
  - Default :level changed to t (was `doom-print-level`)
  - No longer no-ops if OUTPUT is only whitespace
This commit is contained in:
Henrik Lissner 2022-09-11 21:12:58 +02:00
parent 6cac7b05b6
commit b7bd27d22b
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
4 changed files with 226 additions and 170 deletions

View file

@ -796,7 +796,7 @@ However, in batch mode, print to stdout instead of stderr."
(setq msg (match-string 1 msg))))
(and (string-match-p "^\\(Cloning\\|\\(Reb\\|B\\)uilding\\) " msg)
(not (string-suffix-p "...done" msg))
(doom-print (concat "> " msg)))))
(doom-print (concat "> " msg) :format t))))
(defadvice! doom-cli--straight-ignore-gitconfig-a (fn &rest args)
"Prevent user and system git configuration from interfering with git calls."