Skip to content

Commit

Permalink
Use prefix warning and error messages instead of colorizing whole line
Browse files Browse the repository at this point in the history
  • Loading branch information
jscheid committed Sep 7, 2012
1 parent 7ae489c commit 07a8b34
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions kite-console.el
Expand Up @@ -169,6 +169,11 @@
:version "24.1"
:group 'kite-faces)

(defconst kite-level-prefixes
'(("warning" . "WARNING: ")
("error" . "ERROR: "))
"Prefix strings by message log level")

(defcustom kite-console-log-max 1000
"Maximum number of lines to keep in the kite console log buffer.
If nil, disable console logging. If t, log messages but don't truncate
Expand Down Expand Up @@ -409,6 +414,13 @@ debugger."
1 0)))
(concat
(make-string (* 2 kite-message-group-level) 32)
(let ((kite-level-prefix
(cdr (assoc (plist-get message :level) kite-level-prefixes))))
(when kite-level-prefix
(propertize
kite-level-prefix
'font-lock-face (intern (format "kite-log-%s" (plist-get message :level))))))

(when (or (> arg-index 0) (null parameters))
(replace-regexp-in-string
"\\([^%]\\|^\\)\\(%[osd]\\)"
Expand All @@ -419,9 +431,7 @@ debugger."
(kite--console-format-object object)
string))
(setq arg-index (1+ arg-index))))
(propertize
(plist-get message :text)
'font-lock-face (intern (format "kite-log-%s" (plist-get message :level))))
(plist-get message :text)
t ; fixed-case
t ; literal
2)) ; subexp
Expand Down

0 comments on commit 07a8b34

Please sign in to comment.