log4-hi-mode.el
changeset 1622 954b7c665c1a
parent 1610 f88b5c82e16c
child 1623 66e7dd2d4cf4
--- a/log4-hi-mode.el	Tue Sep 22 12:53:26 2020 +0300
+++ b/log4-hi-mode.el	Tue Sep 22 12:55:29 2020 +0300
@@ -35,6 +35,11 @@
   "Face for time."
   :group 'log4-hi)
 
+(defface log4-hi-hide-face
+  '((t :inherit shadow))
+  "Face for extra text for hiding."
+  :group 'log4-hi)
+
 (defvar log4-hi-keywords
   '(("FATAL\\|ERROR" . 'log4-hi-error-face)
     ("WARN\\|SEVERE" . 'log4-hi-warn-face)
@@ -48,6 +53,10 @@
   '(("\\(:?[0-9]\\{2\\}?[0-9]\\{2\\}.[0-9]\\{2\\}.[0-9]\\{2\\}.\\|\\<\\)[0-9]?[0-9]:[0-9][0-9]:[0-9][0-9]\\>\\(:?\\.[0-9]\\{3\\}\\)?" . 'log4-hi-time-face))
   "Highlight regex for ISO date.")
 
+(defvar log4-hi-hide-regex
+  '(("\\[`.\\{3,100\\}`]" . 'log4-hi-hide-face))
+  "Highlight regex for extra text for hiding.")
+
 (defvar log4-hi-func t
   "Mark to use hilighting of function names in stacktraces. Currently only Java supported.")
 
@@ -64,11 +73,13 @@
       (font-lock-mode 1)
       (font-lock-add-keywords nil log4-hi-keywords)
       (font-lock-add-keywords nil log4-hi-time-keywords)
+      (font-lock-add-keywords nil log4-hi-hide-regex)
       (when log4-hi-func (font-lock-add-keywords nil log4-hi-func-keywords))
       (throw 'exit nil))
     (font-lock-remove-keywords nil log4-hi-keywords)
     (font-lock-remove-keywords nil log4-hi-time-keywords)
-    (font-lock-remove-keywords nil log4-hi-func-keywords))
+    (font-lock-remove-keywords nil log4-hi-func-keywords)
+    (font-lock-remove-keywords nil log4-hi-hide-regex))
   (font-lock-flush))
 
 (provide 'log4-hi-mode)