It seems that the logging.Formatter class uses two formats by default to
format a time, default_time_format (%Y-%m-%d %H:%M:%S) and
default_msec_format (%s,%03d). The former is a format string for
time.strftime (and thus can't represent fractions of a second). The latter
accomplishes that, but expanding %s with the output of (I believe)
time.strftime and %03d with the milliseconds in the current time. Users can
pass a datefmt arg to logging.basicConfig, or override the aforementioned
default_*_format attributes. Is there some way to format the timestamp with
both fractions of a second and timezone in a way similar to
datetime.strftime? In particular, I'd be happy with this format:
%Y-%m-%dT%H:%M:%S.%f%z. Maybe there is some magic flag to tell the system
I'm want to use datetime.strftime instead of time.strftime?

Thx,

Skip
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to