Define own faces to remove dependency on compile.el.
(defface log4-hi-error-face
'((t :inherit error))
"Face for critical message.")
(defface log4-hi-warn-face
'((t :inherit warning))
"Face for urgent message.")
(defface log4-hi-info-face
'((t :inherit success))
"Face for informational message.")
(defvar log4-hi-keywords
'(("FATAL\\|ERROR" . 'log4-hi-error-face)
("WARN" . 'log4-hi-warn-face)
("INFO\\|DEBUG\\|TRACE" . 'log4-hi-info-face) ))
;;;###autoload
(define-minor-mode log4-hi-mode
"Highlight standard elements in log4* like log-files."
nil " log4-hi" nil
:global nil
(catch 'exit
(when log4-hi-mode
(font-lock-mode 1)
(font-lock-add-keywords nil log4-hi-keywords)
(throw 'exit nil))
(font-lock-remove-keywords nil log4-hi-keywords))
(font-lock-fontify-buffer))
(provide 'log4-hi-mode)