Bug 148680 - log viewer plugin: time/date of an event
Summary: log viewer plugin: time/date of an event
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-09 14:41 UTC by Damir Perisa
Modified: 2007-08-09 21:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 :)