X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=logger.lisp;h=16a47aff2e5336703a96456c2aba9f48803629ce;hb=f4a678d829c00ccfe0703b18a150332a4520bd85;hp=c434cd3577a810f56db5b968616fe7f27963cf58;hpb=411d337e9bf17aef3f4a67c37bb9b1fb6aa08c85;p=irc-logger.git diff --git a/logger.lisp b/logger.lisp index c434cd3..16a47af 100644 --- a/logger.lisp +++ b/logger.lisp @@ -246,11 +246,6 @@ (format stream "~S~%" (string-right-trim '(#\return) (raw-message-string msg))))) -(uffi:def-foreign-type time-t :unsigned-long) -(uffi:def-function ("ctime" c-ctime) - ((time (* time-t))) - :returning :cstring) - (defconstant +posix-epoch+ (encode-universal-time 0 0 0 1 1 1970 0)) @@ -273,12 +268,11 @@ (defmethod %output-event ((format (eql :sexp)) stream utime type channel source text msg unichannel) - (let ((*print-circle* nil) - (*print-pretty* nil)) + (with-standard-io-syntax (if unichannel (format stream "(~S ~S ~S ~S ~S)~%" utime type source text (last-sexp-field type msg)) - (format stream "(~S ~S ~S ~S ~S ~S)~%" utime type source channel text - (last-sexp-field type msg))))) + (format stream "(~S ~S ~S ~S ~S ~S)~%" utime type source channel text + (last-sexp-field type msg))))) (defmethod %output-event ((format (eql :text)) stream utime type channel source text msg unichannel) @@ -372,10 +366,14 @@ (output-event-for-a-stream msg type channel text logger i)))))))) (defun get-private-log-stream (logger) - (or (private-log-stream logger) *standard-output*)) + (if (and logger (private-log-stream logger)) + (private-log-stream logger) + *standard-output*)) (defun get-unknown-log-stream (logger) - (or (unknown-log-stream logger) *standard-output*)) + (if (and logger (unknown-log-stream logger)) + (unknown-log-stream logger) + *standard-output*)) (defun privmsg-hook (msg) (let ((logger (find-logger-with-connection (connection msg)))