Skip to content

Commit

Permalink
Create debug directory if necessary
Browse files Browse the repository at this point in the history
* helm.el (helm-log-save-maybe): Do it.
  • Loading branch information
Thierry Volpiatto committed May 9, 2018
1 parent 97dcf85 commit a8d272a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions helm.el
Original file line number Diff line number Diff line change
Expand Up @@ -1452,11 +1452,13 @@ e.g (helm-log-error \"Error %s: %s\" (car err) (cdr err))."
(cl-pushnew msg helm-issued-errors :test 'equal))))

(defun helm-log-save-maybe ()
"Save log buffer if `helm-debug-root-directory' is set to a valid directory.
"Save log buffer when `helm-debug-root-directory' is non nil.
Create `helm-debug-root-directory' directory if necessary.
Messages are logged to a file named with todays date and time in this directory."
(when (and (stringp helm-debug-root-directory)
(file-directory-p helm-debug-root-directory)
helm-debug)
(not (file-directory-p helm-debug-root-directory)))
(make-directory helm-debug-root-directory t))
(when helm-debug
(let ((logdir (expand-file-name (concat "helm-debug-"
(format-time-string "%Y%m%d"))
helm-debug-root-directory)))
Expand Down

0 comments on commit a8d272a

Please sign in to comment.