Added a logging function

This commit is contained in:
GLENN THOMPSON 2024-09-22 08:25:28 +03:00
parent 5950762aec
commit ca71cf5fd3
2 changed files with 10 additions and 3 deletions

1
guile-stash.log Normal file
View File

@ -0,0 +1 @@
Symlink created: /home/glenn/stash/test -> /home/glenn/.config/alacritty/test

View File

@ -142,9 +142,15 @@
(eqv? (stat:type stat) 'symlink)))
(define (log-action message)
(with-output-to-file "guile-stash.log"
(lambda () (display message) (newline))
#:append #t))
(let ((log-port (open-file "guile-stash.log" "a"))) ;; Open file in append mode
(display message log-port)
(newline log-port)
(close-port log-port))) ;; Close the port after writing
;; (define (log-action message)
;; (with-output-to-file "guile-stash.log"
;; (lambda () (display message) (newline))
;; #:append #t))
;; Helper function to build target symlink path
(define (build-target-path source target)