Bug 148680

Summary: log viewer plugin: time/date of an event
Product: [Applications] ktorrent Reporter: Damir Perisa <damir.perisa>
Component: generalAssignee: Joris Guisson <joris.guisson>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Damir Perisa 2007-08-09 14:41:35 UTC
Version:           2.2.1 (using KDE 3.5.7, Arch Linux)
Compiler:          Target: i686-pc-linux-gnu
OS:                Linux (i686) release 2.6.22-ARCH

it would be very helpful to have in the log viewer plugin in front of entries the date and time printed when it happens. 

instead of for example:

Initiating connection to x.x.x.x
Timeout occurred

it would be much easier to have it instead like:

2007-08-09 14:30:15 : Initiating connection to x.x.x.x
2007-08-09 14:33:00 : Timeout occurred
Comment 1 Joris Guisson 2007-08-09 19:32:18 UTC
SVN commit 698265 by guisson:

Show date and time in logging output of logviewer plugin 

BUG: 148680


 M  +4 -3      log.cpp  


--- trunk/extragear/network/ktorrent/libktorrent/util/log.cpp #698264:698265
@@ -128,10 +128,11 @@
 			// this could result in the loss of some messages
 			if (!rotate_job)
 			{
-				*out << QDateTime::currentDateTime().toString() << ": " << tmp << ::endl;
+				QString final = QDateTime::currentDateTime().toString() + ": " + tmp;
+				*out << final << ::endl;
 				fptr->flush();
 				if (to_cout)
-					std::cout << tmp.toLocal8Bit().constData() << std::endl;;
+					std::cout << final.toLocal8Bit().constData() << std::endl;;
 				
 				if (monitors.count() > 0)
 				{
@@ -139,7 +140,7 @@
 					while (i != monitors.end())
 					{
 						kt::LogMonitorInterface* lmi = *i;
-						lmi->message(tmp,m_filter);
+						lmi->message(final,m_filter);
 						i++;
 					}
 				}
Comment 2 Damir Perisa 2007-08-09 21:49:09 UTC
wow, that was fast :)