From: vitaly Date: Fri, 15 Jan 2010 13:25:46 +0000 (+0000) Subject: Better logging for imap4 proto X-Git-Tag: elmo-imap4-compliance-root~23 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc2fa85ae16caaccdfe5d961e4e40e81b24973cb;p=elisp%2Fwanderlust.git Better logging for imap4 proto --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 2e1e439..e865f68 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -3,6 +3,11 @@ * elmo-imap4.el (elmo-imap4-elist): New function * elmo-imap4.el (elmo-imap4-parse-response): Added support for ESEARCH feature (RFC4731). + * elmo-imap4.el (toplevel): Require time-stamp + * elmo-imap4.el (elmo-imap4-send-command, elmo-imap4-send-string, + elmo-imap4-read-response elmo-imap4-read-untagged + elmo-imap4-arrival-filter elmo-imap4-parse-response): Change + logging format. 2010-01-05 TAKAHASHI Kaoru diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index cc2be71..73abf31 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -48,6 +48,7 @@ (require 'elmo-net) (require 'utf7) (require 'elmo-mime) +(require 'time-stamp) (eval-when-compile (require 'cl)) @@ -315,7 +316,6 @@ Returns a TAG string which is assigned to the COMMAND." session)) (message "Waiting for IMAP response...done")) (setq elmo-imap4-parsing t) - (elmo-imap4-debug "<-(%s)- %s" tag command) (while (setq token (car command-args)) (cond ((stringp token) ; formatted (setq cmdstr (concat cmdstr token))) @@ -357,6 +357,7 @@ Returns a TAG string which is assigned to the COMMAND." (t (error "Invalid argument"))) (setq command-args (cdr command-args))) + (elmo-imap4-debug "[%s] <- %s" (time-stamp-hh:mm:ss) cmdstr) (process-send-string process (concat cmdstr "\r\n")) tag))) @@ -366,7 +367,7 @@ Returns a TAG string which is assigned to the COMMAND." (elmo-network-session-process-internal session)) (setq elmo-imap4-current-response nil) (goto-char (point-min)) - (elmo-imap4-debug "<-- %s" string) + (elmo-imap4-debug "[%s] <-- %s" (time-stamp-hh:mm:ss) string) (process-send-string (elmo-network-session-process-internal session) string) (process-send-string (elmo-network-session-process-internal session) @@ -391,7 +392,7 @@ TAG is the tag of the command" '(open run)) (accept-process-output (elmo-network-session-process-internal session) 1))) - (elmo-imap4-debug "=>%s" (prin1-to-string elmo-imap4-current-response)) + (elmo-imap4-debug "[%s] =>%s" (time-stamp-hh:mm:ss) (prin1-to-string elmo-imap4-current-response)) (setq elmo-imap4-parsing nil) elmo-imap4-current-response)) @@ -399,7 +400,7 @@ TAG is the tag of the command" (with-current-buffer (process-buffer process) (while (not elmo-imap4-current-response) (accept-process-output process 1)) - (elmo-imap4-debug "=>%s" (prin1-to-string elmo-imap4-current-response)) + (elmo-imap4-debug "[%s] =>%s" (time-stamp-hh:mm:ss) (prin1-to-string elmo-imap4-current-response)) elmo-imap4-current-response)) (defun elmo-imap4-read-continue-req (session) @@ -1289,7 +1290,6 @@ Return nil if no complete line has arrived." "IMAP process filter." (when (buffer-live-p (process-buffer proc)) (with-current-buffer (process-buffer proc) - (elmo-imap4-debug "-> %s" string) (goto-char (point-max)) (insert string) (let (end) @@ -1415,6 +1415,7 @@ Return nil if no complete line has arrived." (defun elmo-imap4-parse-response () "Parse a IMAP command response." + (elmo-imap4-debug "[%s] -> %s" (time-stamp-hh:mm:ss) (buffer-substring (point) (point-max))) (let (token) (case (setq token (read (current-buffer))) (+ (progn