formatting time as milliseconds in logging module
vinay_sajip at yahoo.co.uk
Wed Oct 20 11:16:13 CEST 2004
Stefan Behnel <behnel_ml at dvs1.informatik.tu-darmstadt.de> wrote in message news:<cl2n3g$2lt$1 at lnx107.hrz.tu-darmstadt.de>...
> The logging module nicely prepends each line with a formatted date.
> However, I'm not interested in the actual date but only in the number of
> milliseconds that passed since the start of the program. What is the best
> way of doing that?
Use the relativeCreated attribute of the LogRecord in your message format. See
More information about the Python-list