StandOut logging date/time stamp or general Prefix option?

13 views
Skip to first unread message

cu81...@gmail.com

unread,
Oct 19, 2007, 11:45:10 AM10/19/07
to pythonutils
I'm trying to figure out a easy way to pre-pend a date/time so I can
format this somewhat like other logfiles in /var/log. I can't see
any sort of TimeStamp option, but maybe I'm missing it. There is a
errPrefix option, but it would be nice if there was a "Prefix" one as
well that would prefix everything. That would make it easy to put in
a timestamp.

I'm still new to using this module so I'm guessing it's been done and
I can't see it, or maybe it's been requested.

Anyways thanks for the great module, it's working great for me. Any
help on this would be appreciated.

Keith

Michael Foord

unread,
Oct 22, 2007, 5:11:45 PM10/22/07
to pytho...@googlegroups.com
Hello Keith,

Hmm... I thought this was in, but browsing the docs [1] it doesn't look
like it is. :-(

It should be easy to add - the best place is probably in the 'write'
method of _Stream, probably in the line "data = self._prefix + data"

All the best,

Michael Foord
http://www.manning.com/foord

[1] http://www.voidspace.org.uk/python/standout.html

Reply all
Reply to author
Forward
0 new messages