Commit f024f237 authored by Wheeler Root's avatar Wheeler Root
Browse files

fixed bug when illegal chars are in the log stream

parent 84728440
......@@ -37,6 +37,8 @@
(defgeneric start-file-follower (file-follower)
(:documentation "get a file-follower all set up"))
(defvar *decoding-error-replacement* "DECODING ERROR")
(defmethod start-file-follower ((ff file-follower))
"Associate the file follower with the file it is supposed to be following."
(and
......@@ -53,7 +55,7 @@
(setf (Filestream ff)
(open-fifo (filename ff)))
(setf (Filestream ff)
(open (Filename ff) :direction :input)))
(open (Filename ff) :external-format `(:utf-8 :replacement ,*decoding-error-replacement*) :direction :input)))
#+cmu
(KERNEL:SIMPLE-FILE-ERROR () (warn "no access to file"))
#+sbcl
......@@ -97,13 +99,13 @@ associated with our filename. if there is, we start following that filename."
(if (peek-char nil (filestream ff) nil)
(read-line (filestream ff) nil)
(let ((stat-inode (get-inode-from-filename (filename ff))))
(and (not (eql (inode ff) stat-inode))
(read-line (start-file-follower ff) nil))))
(let ((stat-inode (get-inode-from-filename (filename ff))))
(when (or (not (eql (inode ff) stat-inode))
(not (filestream ff)))
(aif (start-file-follower ff)
(read-line it nil))))))
(and (not (eql (inode ff) stat-inode))
(read-line (start-file-follower ff) nil))))
(let ((stat-inode (get-inode-from-filename (filename ff))))
(when (or (not (eql (inode ff) stat-inode))
(not (filestream ff)))
(aif (start-file-follower ff)
(read-line it nil))))))
(defmethod get-logline ((ff file-follower))
"Wrap the next line of the file associated with the file-follower inside of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment