X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Friece-debug.el;h=cddd944d93e8aa3b8a8f3903c9903f922ef51521;hb=19580aaa990e2d6cda91579c735b7d02f02cd910;hp=eaa1b9e84a8100760c88fd3169c231c0f5f09651;hpb=87270cf0f658e74f636b8222c5219e8e100db588;p=riece diff --git a/lisp/riece-debug.el b/lisp/riece-debug.el index eaa1b9e..cddd944 100644 --- a/lisp/riece-debug.el +++ b/lisp/riece-debug.el @@ -27,23 +27,21 @@ (require 'riece-globals) (require 'riece-options) -(defun riece-debug (message &optional detail) - "Print a one-line debug MESSAGE at the bottom of the frame. -If the optional 2nd argument DETAIL is specified, it is stored into -`riece-debug-buffer'." +(defun riece-debug-1 (message detail) (message "riece-debug: %s" message) (save-excursion (set-buffer riece-debug-buffer) (goto-char (point-max)) - (let ((point (point))) + (let ((time (format-time-string "%Y-%m-%d:%H:%M:%S"))) (if detail - (insert message "\n" detail "\n") - (insert message "\n")) - (goto-char point) - (beginning-of-line) - (while (not (eobp)) - (insert "riece-debug: ") - (forward-line))))) + (insert "*** " time ": " message "\n" detail "\n") + (insert "*** " time ": " message "\n"))))) + +(defun riece-debug (message &optional detail) + "Print a one-line debug MESSAGE at the bottom of the frame. +If the optional 2nd argument DETAIL is specified, it is stored into +`riece-debug-buffer'." + (ignore (riece-debug-1 message detail))) (defun riece-debug-reset-standard-output () "Reset `riece-temp-buffer' to be used as `standard-output'."