Jan. 19, 2014
8:16 p.m.
On Sun, Jan 19, 2014 at 8:55 PM, <exarkun@twistedmatrix.com> wrote:
On 19 Jan, 11:47 pm, dustin@v.igoro.us wrote:
From what I can tell in a few old bugs and the API docs, the key is to
monkey-patch log.FileLogObserver.timeFormat.
Or just politely set it on the instance of FileLogObserver your application creates so as to avoid global side-effects. :)
Ah, which is returned from startLogging, so -- from twisted.python import log lo = log.startLogging(sys.stdout) lo.formatTime = lambda when: datetime.datetime.fromtimestamp(when).strftime("%H:%M:%S.%f") log.msg("Hello!") -- I'm not sure how you'd find that object under Twistd, though. Dustin