Skip to content

Commit

Permalink
Merge pull request #1291 from Fuglesteg/refactor-log-pathname
Browse files Browse the repository at this point in the history
Change log-pathname from being set at compile time
  • Loading branch information
cxxxr authored Feb 9, 2024
2 parents d1818bd + 938e38e commit 0fab8bb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/language-client/request.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@

(cl-package-locks:lock-package :lem-lsp-mode/request)

(defvar *log-pathname* (merge-pathnames "language-client.log" (lem:lem-logdir-pathname)))
(defvar *log-enable* t)
(defvar *log-mutex* (bt:make-lock))

(defun do-log (string &rest args)
(when *log-enable*
(bt:with-lock-held (*log-mutex*)
(ensure-directories-exist *log-pathname*)
(with-open-file (out *log-pathname*
:direction :output
:if-exists :append
:if-does-not-exist :create)
(fresh-line out)
(apply #'format out string args)
(terpri out)))))
(let ((log-pathname (merge-pathnames "language-client.log" (lem:lem-logdir-pathname))))
(ensure-directories-exist log-pathname)
(with-open-file (out log-pathname
:direction :output
:if-exists :append
:if-does-not-exist :create)
(fresh-line out)
(apply #'format out string args)
(terpri out))))))

(defun pretty-json (params)
(with-output-to-string (stream)
Expand Down

0 comments on commit 0fab8bb

Please sign in to comment.