Gnus development mailing list
 help / color / mirror / Atom feed
* any way to timestamp Messages?
@ 2007-06-16 19:04 Sivaram N
  2007-06-18  7:12 ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: Sivaram N @ 2007-06-16 19:04 UTC (permalink / raw)
  To: ding

I have

(setq gnus-verbose 10)
(setq gnus-verbose-backends 10)

in my .gnus.el file.  Is there a way to get it timestamped as it
writes all those messages to the *Messages* buffer?  A configurable
option would be nice.

Maybe get (current-time-string) to be called before writing?

 regards,
 sivaram




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: any way to timestamp Messages?
  2007-06-16 19:04 any way to timestamp Messages? Sivaram N
@ 2007-06-18  7:12 ` Katsumi Yamaoka
  2007-06-18 16:40   ` Sivaram N
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2007-06-18  7:12 UTC (permalink / raw)
  To: Sivaram N; +Cc: ding

>>>>> In <ur6obu3dx.fsf@gmail.com> Sivaram N wrote:

> I have

> (setq gnus-verbose 10)
> (setq gnus-verbose-backends 10)

> in my .gnus.el file.  Is there a way to get it timestamped as it
> writes all those messages to the *Messages* buffer?  A configurable
> option would be nice.

> Maybe get (current-time-string) to be called before writing?

You want timestamps to be only in the *Messages* buffer, don't
you?  There seems to be no way to add timestamps only to the
*Messages* buffer but the following workaround will work:

--8<---------------cut here---------------start------------->8---
(defadvice gnus-message (before add-timestamp (level &rest args) activate)
  "Add a timestamp."
  (setcar args (concat (propertize (concat (current-time-string) "> ")
				   'invisible t)
		       (car args))))

(defadvice nnheader-message (before add-timestamp (level &rest args) activate)
  "Add a timestamp."
  (setcar args (concat (propertize (concat (current-time-string) "> ")
				   'invisible t)
		       (car args))))
--8<---------------cut here---------------end--------------->8---

And here's a version similar to `nntp-record-command'.

--8<---------------cut here---------------start------------->8---
(defadvice gnus-message (before add-timestamp (level &rest args) activate)
  "Add a timestamp."
  (setcar args
	  (concat (propertize
		   (let ((time (current-time)))
		     (concat (format-time-string "%Y%m%dT%H%M%S" time)
			     "." (format "%03d" (/ (nth 2 time) 1000))
			     "> "))
		   'invisible t)
		  (car args))))

(defadvice nnheader-message (before add-timestamp (level &rest args) activate)
[...same as above...]
--8<---------------cut here---------------end--------------->8---



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: any way to timestamp Messages?
  2007-06-18  7:12 ` Katsumi Yamaoka
@ 2007-06-18 16:40   ` Sivaram N
  2007-06-19 12:06     ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: Sivaram N @ 2007-06-18 16:40 UTC (permalink / raw)
  To: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

>>>>>> In <ur6obu3dx.fsf@gmail.com> Sivaram N wrote:
>
>> I have
>
>> (setq gnus-verbose 10)
>> (setq gnus-verbose-backends 10)
>
>> in my .gnus.el file.  Is there a way to get it timestamped as it
>> writes all those messages to the *Messages* buffer?  A configurable
>> option would be nice.
>
>> Maybe get (current-time-string) to be called before writing?
>
> You want timestamps to be only in the *Messages* buffer, don't
> you?  There seems to be no way to add timestamps only to the
> *Messages* buffer but the following workaround will work:
>

[...]

Yes, Whatever chatter Gnus does and writes to the Messages buffer, I'd
like it to be Timestamped.  The functions you provided did that
nicely after I eval'ed them.

If this feature can be plugged in a future release, at least for some
actions especially those involving downloading, refreshing the NG,
sending emails....


 regards,
 sivaram




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: any way to timestamp Messages?
  2007-06-18 16:40   ` Sivaram N
@ 2007-06-19 12:06     ` Katsumi Yamaoka
  2007-06-19 13:52       ` Sivaram N
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2007-06-19 12:06 UTC (permalink / raw)
  To: ding

>>>>> In <u4pl5b4h3.fsf@gmail.com> Sivaram N wrote:

> If this feature can be plugged in a future release, at least for some
> actions especially those involving downloading, refreshing the NG,
> sending emails....

I've implemented this feature in the right way (maybe), in the
Gnus CVS trunk.  Now this is controlled by:

,----
| `gnus-add-timestamp-to-message'
|      This variable controls whether to add timestamps to messages that
|      are issued controlled by `gnus-verbose' and
|      `gnus-verbose-backends'.  The default value is `nil' which means
|      never to add timestamp.  If it is `log', add timestamps to only
|      the messages that go into the `*Messages*' buffer (in XEmacs, it
|      is the ` *Message-Log*' buffer).  If it is neither `nil' nor
|      `log', add timestamps not only to log messages but also to the
|      ones displayed in the echo area.
`----

I use the following so that it may be t when running Gnus as a
cron job:

(setq gnus-add-timestamp-to-message (if noninteractive t 'log))

Regards,



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: any way to timestamp Messages?
  2007-06-19 12:06     ` Katsumi Yamaoka
@ 2007-06-19 13:52       ` Sivaram N
  2007-06-19 23:49         ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: Sivaram N @ 2007-06-19 13:52 UTC (permalink / raw)
  To: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

>>>>>> In <u4pl5b4h3.fsf@gmail.com> Sivaram N wrote:
>
>> If this feature can be plugged in a future release, at least for some
>> actions especially those involving downloading, refreshing the NG,
>> sending emails....
>
> I've implemented this feature in the right way (maybe), in the
> Gnus CVS trunk.  Now this is controlled by:
>
> ,----
> | `gnus-add-timestamp-to-message'
> |      This variable controls whether to add timestamps to messages that
> |      are issued controlled by `gnus-verbose' and
> |      `gnus-verbose-backends'.  The default value is `nil' which means
> |      never to add timestamp.  If it is `log', add timestamps to only
> |      the messages that go into the `*Messages*' buffer (in XEmacs, it
> |      is the ` *Message-Log*' buffer).  If it is neither `nil' nor
> |      `log', add timestamps not only to log messages but also to the
> |      ones displayed in the echo area.
> `----
>
> I use the following so that it may be t when running Gnus as a
> cron job:
>
> (setq gnus-add-timestamp-to-message (if noninteractive t 'log))
>
> Regards,
>
>

many thanks,  I'll download the CVS snapshot to check it out.

And the sentence

"This variable controls whether to add timestamps to messages that are
issued controlled...."
^^^^^^^^^^^^^^^^^

Is that "issued & controlled" or a small typo.



 sivaram
 -- 




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: any way to timestamp Messages?
  2007-06-19 13:52       ` Sivaram N
@ 2007-06-19 23:49         ` Katsumi Yamaoka
  0 siblings, 0 replies; 6+ messages in thread
From: Katsumi Yamaoka @ 2007-06-19 23:49 UTC (permalink / raw)
  To: ding

>>>>> In <uir9kgifq.fsf@gmail.com> Sivaram N wrote:

> "This variable controls whether to add timestamps to messages that are
> issued controlled...."
> ^^^^^^^^^^^^^^^^^

> Is that "issued & controlled" or a small typo.

The truth is that I was a flunked student of the English courses
in Japan. ;-)  So, I honestly welcome such a correction.  Thank you!
I've fixed it into the one looking better (to only my eyes, though):

,----
| This variable controls whether to add timestamps to messages that
| are controlled by `gnus-verbose' and `gnus-verbose-backends' and
| are issued.
`----



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-19 23:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-16 19:04 any way to timestamp Messages? Sivaram N
2007-06-18  7:12 ` Katsumi Yamaoka
2007-06-18 16:40   ` Sivaram N
2007-06-19 12:06     ` Katsumi Yamaoka
2007-06-19 13:52       ` Sivaram N
2007-06-19 23:49         ` Katsumi Yamaoka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).