[Box Backup-commit] COMMIT r2204 - box/trunk/lib/common

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sun Jul 27 21:10:13 BST 2008


Author: chris
Date: 2008-07-27 21:10:13 +0100 (Sun, 27 Jul 2008)
New Revision: 2204

Modified:
   box/trunk/lib/common/Logging.cpp
Log:
Use the new time function when generating console log messages.


Modified: box/trunk/lib/common/Logging.cpp
===================================================================
--- box/trunk/lib/common/Logging.cpp	2008-07-27 20:09:00 UTC (rev 2203)
+++ box/trunk/lib/common/Logging.cpp	2008-07-27 20:10:13 UTC (rev 2204)
@@ -274,35 +274,8 @@
 
 	if (sShowTime)
 	{
-		box_time_t time_now = GetCurrentBoxTime();
-		time_t seconds = BoxTimeToSeconds(time_now);
-		int micros = BoxTimeToMicroSeconds(time_now) % MICRO_SEC_IN_SEC;
-
-		struct tm tm_now, *tm_ptr = &tm_now;
-
-		#ifdef WIN32
-			if ((tm_ptr = localtime(&seconds)) != NULL)
-		#else
-			if (localtime_r(&seconds, &tm_now) != NULL)
-		#endif
-		{
-			buf << std::setfill('0') <<
-				std::setw(2) << tm_ptr->tm_hour << ":" << 
-				std::setw(2) << tm_ptr->tm_min  << ":" <<
-				std::setw(2) << tm_ptr->tm_sec;
-
-			if (sShowTimeMicros)
-			{
-				buf << "." << std::setw(6) << micros;
-			}
-
-			buf << " ";
-		}
-		else
-		{
-			buf << strerror(errno);
-			buf << " ";
-		}
+		buf << FormatTime(GetCurrentBoxTime(), sShowTimeMicros);
+		buf << " ";
 	}
 
 	if (sShowTag)




More information about the Boxbackup-commit mailing list