diff --git a/ChangeLog b/ChangeLog index cc940a8..23dc4e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-03-19 Richard Frith-Macdonald + + * EcProcess.m: + * EcAlerter.m: + Use milliseconds in logging timestamps. + 2015-02-02 Richard Frith-Macdonald * EcAlerter.h: Add options for time-limiting rule activity @@ -19,7 +25,7 @@ * GNUmakefile.preamble: fixup gcc flag filtering * EcClientI.h: - * EcClientI.m: + EcClientI.m: * EcCommand.m: * EcControl.m: * EcProcess.h: diff --git a/EcAlerter.m b/EcAlerter.m index 0b69f7c..65a9061 100644 --- a/EcAlerter.m +++ b/EcAlerter.m @@ -1259,7 +1259,15 @@ replaceFields(NSDictionary *fields, NSString *template) } timestamp = [NSCalendarDate dateWithString: [str substringToIndex: r.location] - calendarFormat: @"%Y-%m-%d %H:%M:%S %z"]; + calendarFormat: @"%Y-%m-%d %H:%M:%S.%F %z"]; + if (nil == timestamp) + { + /* Old style. + */ + timestamp = [NSCalendarDate + dateWithString: [str substringToIndex: r.location] + calendarFormat: @"%Y-%m-%d %H:%M:%S %z"]; + } str = [str substringFromIndex: NSMaxRange(r)]; diff --git a/EcProcess.m b/EcProcess.m index 1b417cc..7c5bae6 100644 --- a/EcProcess.m +++ b/EcProcess.m @@ -460,7 +460,7 @@ cmdLogFormat(EcLogType t, NSString *fmt) { l = [[cmdDefs dictionaryRepresentation] copy]; } - d = [c descriptionWithCalendarFormat: @"%Y-%m-%d %H:%M:%S %z" locale: l]; + d = [c descriptionWithCalendarFormat: @"%Y-%m-%d %H:%M:%S.%F %z" locale: l]; result = [stringClass stringWithFormat: @"%@(%@): %@ %@ - %@\n", n, h, d, f, fmt]; RELEASE(c);