better logging capabilities

This commit is contained in:
Volker Fischer 2006-09-03 09:49:15 +00:00
parent b31360a27a
commit 0c3c3fa8ae
3 changed files with 27 additions and 9 deletions

View file

@ -298,7 +298,7 @@ void CChannel::SetNetwBufSizeFactOut ( const int iNewNetwBlSiFactOut )
void CChannel::OnNetwBlSiFactChange ( int iNewNetwBlSiFact )
{
// TEST
qDebug ( "new network block size factor: %d", iNewNetwBlSiFact );
//qDebug ( "new network block size factor: %d", iNewNetwBlSiFact );
SetNetwBufSizeFactOut ( iNewNetwBlSiFact );
}
@ -340,7 +340,7 @@ void CChannel::SetSockBufSize ( const int iNumBlocks )
void CChannel::OnJittBufSizeChange ( int iNewJitBufSize )
{
// TEST
qDebug ( "new jitter buffer size: %d", iNewJitBufSize );
//qDebug ( "new jitter buffer size: %d", iNewJitBufSize );
SetSockBufSize ( iNewJitBufSize );
}
@ -447,10 +447,10 @@ for ( int i = 0; i < iCurNetwInBlSiFact * MIN_BLOCK_SIZE_SAMPLES; i++ ) {
// inform other objects that new connection was established
if ( bNewConnection )
{
// TEST debug output
CHostAddress address ( GetAddress() );
qDebug ( "new connection with IP %s", address.InetAddr.toString().latin1() );
// log new connection
CHostAddress address ( GetAddress() );
qDebug ( CLogTimeDate::toString() + "Connected with IP %s",
address.InetAddr.toString().latin1() );
emit NewConnection();
}

View file

@ -27,7 +27,7 @@
/* Implementation *************************************************************/
CServer::CServer () : Socket ( &ChannelSet, this )
{
{
vecsSendData.Init ( MIN_BLOCK_SIZE_SAMPLES );
/* init moving average buffer for response time evaluation */
@ -73,7 +73,7 @@ void CServer::Start ()
/* init time for response time evaluation */
TimeLastBlock = QTime::currentTime ();
qDebug("Server started");
qDebug ( CLogTimeDate::toString() + "Server started" );
}
}
@ -82,7 +82,7 @@ void CServer::Stop ()
/* stop main timer */
Timer.stop ();
qDebug("Server stopped");
qDebug ( CLogTimeDate::toString() + "Server stopped" );
}
void CServer::OnTimer ()

View file

@ -436,6 +436,24 @@ public:
);
}
};
/* Time and Data to String conversion --------------------------------------- */
class CLogTimeDate
{
public:
static QString toString()
{
const QDateTime curDateTime = QDateTime::currentDateTime();
// format date and time output according to "3.9.2006 11:38:08: "
return QString().setNum ( curDateTime.date().day() ) + "." +
QString().setNum ( curDateTime.date().month() ) + "." +
QString().setNum ( curDateTime.date().year() ) + " " +
curDateTime.time().toString() + ": ";
}
};
#endif /* !defined(UTIL_HOIH934256GEKJH98_3_43445KJIUHF1912__INCLUDED_) */