diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-04-27 15:59:32 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2019-04-27 15:59:32 +0900 |
commit | 0e7f9b8db10ef4c4fbc414bf2c6d804265c54ca4 (patch) | |
tree | 18599b1d25e1638de4717f80b900455f4acb8b22 | |
parent | 732ca8a6eceb311215495663b3d3b683a3c84343 (diff) | |
download | tdelibs-0e7f9b8db10ef4c4fbc414bf2c6d804265c54ca4.tar.gz tdelibs-0e7f9b8db10ef4c4fbc414bf2c6d804265c54ca4.zip |
Added timestamp to debug backend (kdDebug, kdWarning, ...).
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r-- | tdecore/kdebug.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
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 ) |