diff options
author | Teddy Wing | 2021-02-21 17:56:14 +0100 |
---|---|---|
committer | Teddy Wing | 2021-02-21 17:56:14 +0100 |
commit | 38222bb0ae1d282a458c3318a1789d932bd0655b (patch) | |
tree | b3e9afeef3be0a681d6fe0a66535a726c60c71c6 /l/src/config.lisp | |
parent | 43cebf3ff4014510e9e4b034fbc630eb87561c7f (diff) | |
download | extreload-38222bb0ae1d282a458c3318a1789d932bd0655b.tar.bz2 |
Add `--debug` option to print debug output
Let's keep a way to print WebSocket messages for debugging purposes in
the release build rather than remove the messages completely. Since I've
been struggling with the messages so much it seems like this could be a
useful thing to have.
Diffstat (limited to 'l/src/config.lisp')
-rw-r--r-- | l/src/config.lisp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/l/src/config.lisp b/l/src/config.lisp index f826537..d01a1fd 100644 --- a/l/src/config.lisp +++ b/l/src/config.lisp @@ -14,6 +14,11 @@ :initform nil :reader reload-current-tab :documentation "True if the current tab should be reloaded") + (debug-output + :initarg :debug-output + :initform nil + :reader debug-output + :documentation "True to enable debug output") (ws-client :reader ws-client @@ -21,16 +26,26 @@ (defmethod print-object ((object config) stream) (print-unreadable-object (object stream :type t) - (with-slots (socket-url extension-ids reload-current-tab ws-client) object - (format stream - ":socket-url ~s :extension-ids ~s :reload-current-tab ~s :ws-client ~s" - socket-url extension-ids reload-current-tab ws-client)))) + (with-slots (socket-url + extension-ids + reload-current-tab + debug-output + ws-client) + object + (format + stream + ":socket-url ~s :extension-ids ~s :reload-current-tab ~s :debug-output ~s :ws-client ~s" + socket-url extension-ids reload-current-tab debug-output ws-client)))) -(defun make-config (&key socket-url extension-ids reload-current-tab) +(defun make-config (&key socket-url + extension-ids + reload-current-tab + debug-output) (let ((config (make-instance 'config :socket-url socket-url :extension-ids extension-ids - :reload-current-tab reload-current-tab))) + :reload-current-tab reload-current-tab + :debug-output debug-output))) ;; Initialise a new websocket-driver client (setf (slot-value config 'ws-client) (wsd:make-client socket-url)) |