From fe423b35a83c82acae185a122652cc221debe8d2 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 27 Apr 2019 15:59:32 +0900 Subject: Added timestamp to debug backend (kdDebug, kdWarning, ...). Signed-off-by: Michele Calgaro (cherry picked from commit 0e7f9b8db10ef4c4fbc414bf2c6d804265c54ca4) --- tdecore/kdebug.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tdecore/kdebug.cpp') diff --git a/tdecore/kdebug.cpp b/tdecore/kdebug.cpp index 73094ecd5..d906f67fc 100644 --- a/tdecore/kdebug.cpp +++ b/tdecore/kdebug.cpp @@ -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 ) -- cgit v1.2.1