Permalink
Browse files

Integrated new debugging framework

* rudel-debug.el (header): updated copyright; fixed keywords; extended
  commentary section; added 0.2 to history section
  (require rudel-transport-util):
  (require rudel-socket): now required, since we install methods
  (rudel-debug-tag-faces): changed from constant to variable
  (rudel-state-change :before):
  (rudel-debug-stream-name):
  (rudel-debug-stream-insert): removed; replaced by
  `rudel-debug-write-to-stream' and `rudel-debug-write'
  (rudel-debug-target): new generic function; determine debug stream
  for an object
  (rudel-debug-write-to-stream): new function; write information to
  debug stream
  (rudel-debug-write): new function; write information to debug stream
  for a specific object
  (rudel-debug-old-state):
  (rudel-state-machine::rudel-switch :before):
  (rudel-state-machine::rudel-switch :after): new variable/methods;
  state machine debugging
  (rudel-assembling-transport-filter::rudel-set-assembly-function	:before):
  (rudel-assembling-transport-filter::rudel-set-filter):
  (rudel-assembling-transport-filter::rudel-send :before): new
  methods; debugging for `rudel-assembling-transport-filter'
  (rudel-parsing-transport-filter::rudel-set-parse-function :before):
  (rudel-parsing-transport-filter::rudel-set-generate-function :before):
  (rudel-parsing-transport-filter::rudel-set-filter):
  (rudel-parsing-transport-filter::rudel-send :before): new methods;
  debugging for `rudel-parsing-transport-filter'
  (rudel-socket-transport::rudel-set-filter):
  (rudel-socket-transport::rudel-send :before): new methods; debugging
  for `rudel-socket-transport'
* xmpp/rudel-xmpp-debug.el (header): fixed keywords; added 0.2 to
  history section
  (require rudel-xmpp-state): now required, since we install methods
  (rudel-xmpp-debug-old-state):
  (rudel-xmpp-transport::rudel-send :before):
  (rudel-xmpp-transport::rudel-accept :before): 
  (rudel-xmpp-transport::rudel-switch :before):
  (rudel-xmpp-transport::rudel-switch :after): removed; handled by
  generic stuff in rudel-debug.el now
  (rudel-xmpp-state::rudel-debug-target): new method; debug target for
  XMPP states
  (rudel-xmpp-state-sasl-mechanism-step::rudel-send):
  (rudel-xmpp-state-sasl-mechanism-step::rudel-send :after):
  (rudel-xmpp-state-sasl-mechanism-step::rudel-accept :before):
  rewritten for new debugging framework
* obby/rudel-obby-debug.el (header): updated copyright; added 0.2 to
  history section
  (require eieio):
  (require rudel-obby-util): removed; no longer needed
  (require rudel-obby-server): now required, since we install methods
  on server classes
  (rudel-obby-debug-old-state):
  (rudel-obby-connection::rudel-send :before):
  (rudel-obby-connection::rudel-accept :before):
  (rudel-obby-connection::rudel-switch :before):
  (rudel-obby-connection::rudel-switch :after): removed; handled by
  generic stuff in rudel-debug.el now
  (rudel-obby-connection::rudel-debug-target): new method; debug
  target for `rudel-obby-connection'
  (rudel-obby-client::rudel-debug-target): new method; debug target
  for `rudel-obby-client'
* TODO (Milestone 0.3): integrate new debugging framework is DONE
  • Loading branch information...
1 parent a9da766 commit 6d9c9ca981a2f4dfca214731d35f2edea7ff61d1 @scymtym committed Jan 27, 2010
Showing with 349 additions and 201 deletions.
  1. +65 −0 ChangeLog
  2. +6 −6 TODO
  3. +13 −58 obby/rudel-obby-debug.el
  4. +213 −39 rudel-debug.el
  5. +52 −98 xmpp/rudel-xmpp-debug.el
View
@@ -1,5 +1,70 @@
2010-01-27 Jan Moringen <scymtym@users.sourceforge.net>
+ Integrated new debugging framework
+ * rudel-debug.el (header): updated copyright; fixed keywords;
+ extended commentary section; added 0.2 to history section
+ (require rudel-transport-util):
+ (require rudel-socket): now required, since we install methods
+ (rudel-debug-tag-faces): changed from constant to variable
+ (rudel-state-change :before):
+ (rudel-debug-stream-name):
+ (rudel-debug-stream-insert): removed; replaced by
+ `rudel-debug-write-to-stream' and `rudel-debug-write'
+ (rudel-debug-target): new generic function; determine debug stream
+ for an object
+ (rudel-debug-write-to-stream): new function; write information to
+ debug stream
+ (rudel-debug-write): new function; write information to debug
+ stream for a specific object
+ (rudel-debug-old-state):
+ (rudel-state-machine::rudel-switch :before):
+ (rudel-state-machine::rudel-switch :after): new variable/methods;
+ state machine debugging
+ (rudel-assembling-transport-filter::rudel-set-assembly-function :before):
+ (rudel-assembling-transport-filter::rudel-set-filter):
+ (rudel-assembling-transport-filter::rudel-send :before): new
+ methods; debugging for `rudel-assembling-transport-filter'
+ (rudel-parsing-transport-filter::rudel-set-parse-function :before):
+ (rudel-parsing-transport-filter::rudel-set-generate-function :before):
+ (rudel-parsing-transport-filter::rudel-set-filter):
+ (rudel-parsing-transport-filter::rudel-send :before): new methods;
+ debugging for `rudel-parsing-transport-filter'
+ (rudel-socket-transport::rudel-set-filter):
+ (rudel-socket-transport::rudel-send :before): new methods;
+ debugging for `rudel-socket-transport'
+ * xmpp/rudel-xmpp-debug.el (header): fixed keywords; added 0.2 to
+ history section
+ (require rudel-xmpp-state): now required, since we install methods
+ (rudel-xmpp-debug-old-state):
+ (rudel-xmpp-transport::rudel-send :before):
+ (rudel-xmpp-transport::rudel-accept :before):
+ (rudel-xmpp-transport::rudel-switch :before):
+ (rudel-xmpp-transport::rudel-switch :after): removed; handled by
+ generic stuff in rudel-debug.el now
+ (rudel-xmpp-state::rudel-debug-target): new method; debug target
+ for XMPP states
+ (rudel-xmpp-state-sasl-mechanism-step::rudel-send):
+ (rudel-xmpp-state-sasl-mechanism-step::rudel-send :after):
+ (rudel-xmpp-state-sasl-mechanism-step::rudel-accept :before):
+ rewritten for new debugging framework
+ * obby/rudel-obby-debug.el (header): updated copyright; added 0.2
+ to history section
+ (require eieio):
+ (require rudel-obby-util): removed; no longer needed
+ (require rudel-obby-server): now required, since we install
+ methods on server classes
+ (rudel-obby-debug-old-state):
+ (rudel-obby-connection::rudel-send :before):
+ (rudel-obby-connection::rudel-accept :before):
+ (rudel-obby-connection::rudel-switch :before):
+ (rudel-obby-connection::rudel-switch :after): removed; handled by
+ generic stuff in rudel-debug.el now
+ (rudel-obby-connection::rudel-debug-target): new method; debug
+ target for `rudel-obby-connection'
+ (rudel-obby-client::rudel-debug-target): new method; debug target
+ for `rudel-obby-client'
+ * TODO (Milestone 0.3): integrate new debugging framework is DONE
+
Updated TODO
* TODO (Future):
(Milestone 0.4): minor adjustments
View
12 TODO
@@ -160,12 +160,6 @@
* Milestone rudel-0.3
-** TODO Integrate new debugging framework
- + Component :: multiple components affected
- + Type :: task
- + Priority :: major
- + Reporter :: jan
- + Assigned :: jan
** TODO Infinote client functionality
+ Component :: infinote-backend
+ Type :: task
@@ -225,6 +219,12 @@
+ Type :: defect
+ Reporter :: jan
+ Assigned ::
+** DONE Integrate new debugging framework
+ + Component :: multiple components affected
+ + Type :: task
+ + Priority :: major
+ + Reporter :: jan
+ + Assigned :: jan
** DONE Add XMPP transport backend
+ Component :: xmpp-backend
+ Type :: task
View
@@ -1,6 +1,6 @@
;;; rudel-obby-debug.el --- Debugging functions for obby backend
;;
-;; Copyright (C) 2009 Jan Moringen
+;; Copyright (C) 2009, 2010 Jan Moringen
;;
;; Author: Jan Moringen <scymtym@users.sourceforge.net>
;; Keywords: rudel, obby, debugging
@@ -27,81 +27,36 @@
;;; History:
;;
+;; 0.2 - New debug infrastructure
+;;
;; 0.1 - Initial version
;;; Code:
;;
-(require 'eieio)
-
(require 'rudel-debug)
-(require 'rudel-obby-util)
(require 'rudel-obby-client)
+(require 'rudel-obby-server)
-;;; Variables
+;;; Client connection debugging
;;
-(defvar rudel-obby-debug-old-state nil
- "Saves state of state machines across one function call.")
+(defmethod rudel-debug-target ((this rudel-obby-connection))
+ "Return debug target of the transport as debug target for THIS."
+ (with-slots (transport) this
+ (rudel-debug-target transport)))
-;;; Functions
+;;; Server connection debugging
;;
-(defmethod rudel-send :before ((this rudel-obby-connection)
- name &rest arguments)
- "Print NAME and ARGUMENTS to debug stream."
- (let ((message (apply #'rudel-obby-assemble-message
- name arguments)))
-
- (with-slots (transport) this
- (rudel-debug-stream-insert
- (rudel-debug-stream-name transport)
- :sent
- (concat (substring message 0 (min (length message) 100))
- (when (> (length message) 100)
- "..."))
- (append (list name) arguments))))
- )
-
-(defmethod rudel-accept :before ((this rudel-obby-connection) data)
- "Print DATA to debug stream."
+(defmethod rudel-debug-target ((this rudel-obby-client))
+ "Return debug target of the transport as debug target for THIS."
(with-slots (transport) this
- (rudel-debug-stream-insert
- (rudel-debug-stream-name transport)
- :received
- (concat (substring data 0 (min (length data) 100))
- (when (> (length data) 100)
- "..."))))
- )
-
-(defmethod rudel-switch :before ((this rudel-obby-connection)
- state &rest arguments)
- "Store name of STATE for later printing."
- (with-slots (state) this
- (setq rudel-obby-debug-old-state
- (if state
- (object-name-string state)
- "#start")))
- )
-
-(defmethod rudel-switch :after ((this rudel-obby-connection)
- state &rest arguments)
- "Print STATE and ARGUMENTS to debug stream."
- (with-slots (transport state) this
- (let ((old-state rudel-obby-debug-old-state)
- (new-state (object-name-string state)))
- (unless (string= old-state new-state)
- (rudel-debug-stream-insert
- (rudel-debug-stream-name transport)
- :special
- (if arguments
- (format "%s -> %s %s" old-state new-state arguments)
- (format "%s -> %s" old-state new-state))))))
- )
+ (rudel-debug-target transport)))
(provide 'rudel-obby-debug)
;; Local Variables:
Oops, something went wrong.

0 comments on commit 6d9c9ca

Please sign in to comment.