X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=logger.lisp;h=6585a0f959a1230ba3be23cabd03b2ec9fbf2529;hb=c2f7c7ad5161e03b1694cb8fe02ff908933d9d53;hp=99b5bd3cb034c66ec75607b60dca0c9096067f38;hpb=6f2c823a54092e9f1db233d0caf7f0d338543ef9;p=irc-logger.git diff --git a/logger.lisp b/logger.lisp index 99b5bd3..6585a0f 100644 --- a/logger.lisp +++ b/logger.lisp @@ -9,7 +9,7 @@ (defvar *daemon-monitor-process* nil "Process of background monitor.") (defparameter *timeout* 60) -(defclass channel () +(defclass log-channel () ((name :initarg :name :reader c-name :documentation "Name of channel.") (streams :initarg :streams :reader streams @@ -396,9 +396,13 @@ (output-event msg :privmsg channel (trailing-argument msg)))))) (defun action-hook (msg) - (output-event msg :action (first (arguments msg)) - (subseq (trailing-argument msg) 8 - (- (length (trailing-argument msg)) 1)))) + (let ((end (- (length (trailing-argument msg)) 1))) + ;; end has been as low as 7 + (when (< end 8) + (warn "End is less than 8: `~A'." msg)) + (output-event msg :action (first (arguments msg)) + (subseq (trailing-argument msg) (min 8 end) + (- (length (trailing-argument msg)) 1))))) (defun nick-hook (msg) (output-event msg :nick nil (trailing-argument msg))) @@ -484,7 +488,7 @@ (defun make-a-channel (name formats output) - (make-instance 'channel + (make-instance 'log-channel :name name :streams (make-array (length formats) :initial-element nil) :output-root (when (and (pathnamep output)