@@ -148,7 +148,6 @@ the `eask-start' execution.")
148148 (eask-with-progress
149149 (ansi-green " Loading package information... " )
150150 (eask-with-verbosity 'debug
151- (message " " )
152151 (package-initialize ) (package-refresh-contents ))
153152 (ansi-green " done" )))
154153
@@ -163,7 +162,6 @@ the `eask-start' execution.")
163162 (eask-with-progress
164163 (format " - Installing %s (%s )... " pkg-string pkg-version)
165164 (eask-with-verbosity 'debug
166- (message " " )
167165 (package-refresh-contents )
168166 ; ; XXX Without ignore-errors guard, it will trigger error
169167 ; ;
@@ -573,7 +571,8 @@ Standard is, 0 (error), 1 (warning), 2 (info), 3 (log), 4 or above (debug)."
573571(defmacro eask-with-verbosity (symbol &rest body )
574572 " If LEVEL is above `eask-verbosity' ; hide all messages in BODY."
575573 (declare (indent 1 ) (debug t ))
576- `(if (eask--reach-verbosity-p ,symbol ) (progn ,@body ) (eask--silent ,@body )))
574+ `(if (eask--reach-verbosity-p ,symbol ) (progn ,@body )
575+ (eask--silent ,@body )))
577576
578577(defun eask-debug (msg &rest args ) (apply #'eask--msg 'debug " [DEBUG]" msg args))
579578(defun eask-log (msg &rest args ) (apply #'eask--msg 'log " [LOG]" msg args))
@@ -669,7 +668,8 @@ Standard is, 0 (error), 1 (warning), 2 (info), 3 (log), 4 or above (debug)."
669668(defmacro eask-with-progress (msg-start body msg-end )
670669 " Progress BODY wrapper with prefix and suffix messages."
671670 (declare (indent 0 ) (debug t ))
672- `(progn (eask-write ,msg-start ) ,body (eask-msg ,msg-end )))
671+ `(progn (ignore-errors (eask-write ,msg-start )) ,body
672+ (ignore-errors (eask-msg ,msg-end ))))
673673
674674(defun eask-progress-seq (prefix sequence suffix func )
675675 " Progress SEQUENCE with messages."
@@ -686,6 +686,16 @@ Standard is, 0 (error), 1 (warning), 2 (info), 3 (log), 4 or above (debug)."
686686 suffix))
687687 sequence)))
688688
689+ (defun eask-print-log ()
690+ " Loop through each line and print each line with corresponds log level."
691+ (goto-char (point-min ))
692+ (while (not (eobp ))
693+ (let ((line (buffer-substring-no-properties (line-beginning-position ) (line-end-position ))))
694+ (cond ((string-match-p " [eE]rror: " line) (eask-error line))
695+ ((string-match-p " [Ww]arning: " line) (eask-warn line))
696+ (t (eask-log line))))
697+ (forward-line 1 )))
698+
689699; ;
690700; ;; User customization
691701
0 commit comments