diff options
-rw-r--r-- | elogt.el | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -25,7 +25,7 @@ ;; Version: 0.0.0 ;; Keywords: convenience ;; Homepage: https://gitweb.gentoo.org/proj/emacs-elogt.git -;; Package-Requires: ((emacs "24.3")) +;; Package-Requires: ((emacs "27.1")) ;; SPDX-License-Identifier: GPL-2.0-or-later @@ -116,10 +116,16 @@ A logfile priority level is one of: None, Info, Warn, Error." ((member 'warn found-stars) (elogt--priority-level-property 'warn)) (t (elogt--priority-level-property 'info))))) +(defun elogt--file-size (file-path) + "Return size of a given file at FILE-PATH." + (file-size-human-readable-iec + (file-attribute-size (file-attributes file-path)))) + (defun elogt--logfile-properties (file-name) "Extract the properties form given FILE-NAME." - (apply #'vector (cons (elogt--logfile-priority-level file-name) - (split-string (file-name-base file-name) ":")))) + (apply #'vector `(,(elogt--logfile-priority-level file-name) + ,@(split-string (file-name-base file-name) ":") + ,(elogt--file-size file-name)))) (defun elogt--make-log-table-contents () "Make ElogT table contents." @@ -203,7 +209,8 @@ Return opened buffer (done via `find-file')." [("Priority" 10 t) ("Category" 20 t) ("Package" 30 t) - ("Time" 20 t)]) + ("Time" 20 t) + ("Size" 10 t)]) (setq tabulated-list-sort-key (cons "Time" t)) (run-hooks 'elogt-mode-hook) (use-local-map elogt-mode-map)) |