diff options
author | Boutade <thegoofist@protonmail.com> | 2019-09-25 10:25:22 -0500 |
---|---|---|
committer | Boutade <thegoofist@protonmail.com> | 2019-09-25 10:25:22 -0500 |
commit | 53b2725935447b3a57e0c3381155f5a0fbf395f8 (patch) | |
tree | f3b32bc23974bbf3c2a76aa4f9b29a094f954b66 /utility-apps.lisp | |
parent | 6618943207bfad3947e0029637e5fe71d7cbd3d8 (diff) |
added basic logging example
Diffstat (limited to 'utility-apps.lisp')
-rw-r--r-- | utility-apps.lisp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/utility-apps.lisp b/utility-apps.lisp new file mode 100644 index 0000000..4f4b2db --- /dev/null +++ b/utility-apps.lisp @@ -0,0 +1,17 @@ +(in-package :granolin) + +(defclass message-log () + ((output + :accessor output + :initarg :output + :initform (error "Message Log requires an output stream") + :type stream + :documentation "An output stream to which messages are logged." + ))) + +(defmethod handle-timeline-event :after ((log message-log) room (event timeline-event)) + (format (output log) "~a in ~a: ~a~%" + (sender event) + room + (msg-body event))) + |