Review Request: extention of TIME_STAMP within kDebug

Aurélien Gâteau agateau at kde.org
Wed Jun 9 13:35:46 BST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/4260/#review6051
-----------------------------------------------------------


The idea can be quite handy, but I think the code can be made a bit more efficient by not reading the value of the environment variable everytime if timestamp is enabled. Here is what I have in mind:

static int readDebugTimeStampVar() {
    QByteArray var = qgetenv("KDE_DEBUG_TIMESTAMP");
    if (var.isEmpty()) {
        return 0;
    }
    return var.toInt();
}

You can then turn printTimeStamp into an int:

static int debugTimeStamp = readDebugTimeStampVar();

if (debugTimeStamp) {
    if (debugTimeStamp == 2) {

- Aurélien


On 2010-06-08 17:58:41, Guy Maurel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/4260/
> -----------------------------------------------------------
> 
> (Updated 2010-06-08 17:58:41)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> If you export KDE_DEBUG_TIMESTAMP=1 then you'll get time information in front of every debug line.
> you get the time as
> 17:03:24
> 
> If you want to get a little bit more, such as 
> 17:03:24.123
> 
> with the milliseconds, you export KDE_DEBUG_TIMESTAMP=2 and the extention, as proposed here
> 
> 
> Diffs
> -----
> 
>   /branches/KDE/4.4/kdelibs/kdecore/io/kdebug.cpp 1136017 
> 
> Diff: http://reviewboard.kde.org/r/4260/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Guy
> 
>





More information about the kde-core-devel mailing list