aboutsummaryrefslogtreecommitdiffstats
path: root/elisp
diff options
context:
space:
mode:
authorÓscar Nájera <hi@oscarnajera.com>2022-10-11 06:32:03 +0200
committerÓscar Nájera <hi@oscarnajera.com>2022-10-11 10:32:36 +0200
commitacab540eaf4f31f6877d2e216d71afc31053c18d (patch)
tree703e9be0f82fbe9108c528e7aaed528dce307b26 /elisp
parente130c7984df9991e3158db02a5a54255e60c17bd (diff)
downloaddotfiles-acab540eaf4f31f6877d2e216d71afc31053c18d.tar.gz
dotfiles-acab540eaf4f31f6877d2e216d71afc31053c18d.tar.bz2
dotfiles-acab540eaf4f31f6877d2e216d71afc31053c18d.zip
journalctl display match font-lock
Diffstat (limited to 'elisp')
-rw-r--r--elisp/journalctl.el24
1 files changed, 13 insertions, 11 deletions
diff --git a/elisp/journalctl.el b/elisp/journalctl.el
index c95c564..2d16240 100644
--- a/elisp/journalctl.el
+++ b/elisp/journalctl.el
@@ -27,7 +27,7 @@
"Keeps the optetes of the last call of journalctl.")
(defcustom journalctl-error-keywords
- '("Failed" "failed" "Error" "error" "critical" "couldn't" "Can't" "not" "Not" "unreachable")
+ '("Failed" "failed" "Error" "error" "critical" "couldn't" "Can't" "not" "Not" "unreachable" "FATAL")
"Keywords that mark errors in journalctl output."
:group 'journalctl
:type 'string)
@@ -78,7 +78,7 @@
:group 'journalctl)
(defface journalctl-host-face
- '((t :inherit font-lock-keyword-face))
+ '((t :inherit font-lock-constant-face))
"Face for hosts in journalctl's output."
:group 'journalctl)
@@ -88,24 +88,26 @@
:group 'journalctl)
(defvar journalctl-font-lock-keywords
- (let* (
- ;; generate regex string for each category of keywords
- (error-keywords-regexp (regexp-opt journalctl-error-keywords 'words))
- (warn-keywords-regexp (regexp-opt journalctl-warn-keywords 'words))
- (starting-keywords-regexp (regexp-opt journalctl-starting-keywords 'words))
- (finished-keywords-regexp (regexp-opt journalctl-finished-keywords 'words)))
+ (let (
+ ;; generate regex string for each category of keywords
+ (error-keywords-regexp (regexp-opt journalctl-error-keywords 'words))
+ (warn-keywords-regexp (regexp-opt journalctl-warn-keywords 'words))
+ (starting-keywords-regexp (regexp-opt journalctl-starting-keywords 'words))
+ (finished-keywords-regexp (regexp-opt journalctl-finished-keywords 'words)))
`(
(,warn-keywords-regexp . 'journalctl-warning-face)
(,error-keywords-regexp . 'journalctl-error-face)
(,starting-keywords-regexp . 'journalctl-starting-face)
(,finished-keywords-regexp . 'journalctl-finished-face)
- ("^\\([A-Z][a-z]+ [0-9]+ [0-9:]+\\)" . (1 'journalctl-timestamp-face))
- ("^\\([A-Z][a-z]+ [0-9]+ [0-9:]+\\) \\(\\(?:[[:alnum:]]\\|\\.\\)+\\)" . (2 'journalctl-host-face))
- ("^\\([A-Z][a-z]+ [0-9]+ [0-9:]+\\) \\(\\(?:[[:alnum:]]\\|\\.\\)+\\) \\(.*?:\\)" . (3 'journalctl-process-face))
+ ("^\\([A-Z][a-z]+ [0-9]+ [0-9:]+\\) \\(\\(?:[[:alnum:]]\\|\\.\\)+\\) \\(.*?:\\)"
+ (1 'journalctl-timestamp-face)
+ (2 'journalctl-host-face)
+ (3 'journalctl-process-face))
;; note: order above matters, because once colored, that part won't change.
;; in general, put longer words first
)))
+
(defcustom journalctl-hosts
'("/ssh:alina|sudo::"
"/ssh:nina|sudo::"