Mercurial > emacs
changeset 87876:5350f7d1e7aa
(server-log-time-function): New function.
(server-log): Use it.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Mon, 21 Jan 2008 12:05:28 +0000 |
parents | 93df968ca435 |
children | 477edf716b1b |
files | lisp/server.el |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/server.el Mon Jan 21 04:47:10 2008 +0000 +++ b/lisp/server.el Mon Jan 21 12:05:28 2008 +0000 @@ -291,17 +291,20 @@ (server-log "Deleted" proc)))) +(defvar server-log-time-function 'current-time-string + "Function to generate timestamps for the *server* buffer.") + (defun server-log (string &optional client) "If a *server* buffer exists, write STRING to it for logging purposes. If CLIENT is non-nil, add a description of it to the logged message." (when (get-buffer "*server*") (with-current-buffer "*server*" (goto-char (point-max)) - (insert (current-time-string) + (insert (funcall server-log-time-function) (cond - ((null client) " ") - ((listp client) (format " %s: " (car client))) - (t (format " %s: " client))) + ((null client) " ") + ((listp client) (format " %s: " (car client))) + (t (format " %s: " client))) string) (or (bolp) (newline)))))