Added timestamp to debug backend (kdDebug, kdWarning, ...).

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/29/head
Michele Calgaro 5 years ago
parent 732ca8a6ec
commit 0e7f9b8db1
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -294,13 +294,15 @@ static void kDebugBackend( unsigned short nLevel, unsigned int nArea, const char
const int BUFSIZE = 4096;
char buf[BUFSIZE];
if ( !kDebug_data->aAreaName.isEmpty() ) {
strlcpy( buf, kDebug_data->aAreaName.data(), BUFSIZE );
strlcat( buf, ": ", BUFSIZE );
strlcpy( buf, TQDateTime::currentDateTime().toString("[yyyy/MM/dd hh:mm:ss.zzz] [").ascii(), BUFSIZE );
strlcat( buf, kDebug_data->aAreaName.data(), BUFSIZE );
strlcat( buf, "] ", BUFSIZE );
strlcat( buf, data, BUFSIZE );
}
else {
strlcpy( buf, TQDateTime::currentDateTime().toString("[yyyy/MM/dd hh:mm:ss.zzz] ").ascii(), BUFSIZE );
strlcat( buf, data, BUFSIZE );
}
else
strlcpy( buf, data, BUFSIZE );
// Output
switch( nOutput )

Loading…
Cancel
Save