logging time format millisecond precision

Alex van der Spek zdoor at xs4all.nl
Thu Jul 19 22:06:32 CEST 2012


I use this formatter in logging:

formatter = logging.Formatter(fmt='%(asctime)s \t %(name)s \t %(levelname)s 
\t %(message)s')

Sample output:

2012-07-19 21:34:58,382   root   INFO   Removed - C:\Users\ZDoor\Documents

The time stamp has millisecond precision but the decimal separator is a 
comma.

Can I change the comma (,) into a period (.) and if so how?

Thanks in advance,
Alex van der Spek 




More information about the Python-list mailing list