From 5f61e9c2fcd50b1bdced1cdb49d8aaaab56970ed Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 27 Jun 2003 15:06:46 +0000 Subject: [PATCH] Fractional seconds need leading 0s and all 9 digits Changed timestamp output format to one that can be easily parsed Added flush after each anomaly to stop pipes from buffering output --- src/ca/casw.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ca/casw.cpp b/src/ca/casw.cpp index 27729aac0..fe2bc1e7b 100644 --- a/src/ca/casw.cpp +++ b/src/ca/casw.cpp @@ -247,7 +247,7 @@ int main ( int argc, char ** argv ) if ( anomaly ) { char date[64]; currentTime.strftime ( date, sizeof ( date ), - "%a %b %d %Y %H:%M:%S.%f"); + "%Y-%m-%d %T.%09f"); char host[64]; ipAddrToA ( &ina, host, sizeof ( host ) ); printf ( "%-40s %s\n", @@ -256,6 +256,7 @@ int main ( int argc, char ** argv ) printf ( "\testimate=%f current=%f\n", pBHE->period (), currentTime - previousTime ); } + fflush(stdout); } } else {