kdbgstream Tracer::swarning(const char* method) const
{
    // return a NULL stream if the current set tracelevel is higher
    if (m_tracelevel > LEVEL_WARNING) {
        return kdbgstream("", 0, KDEBUG_WARN, false);
    }
    
    return kdbgstream(prepareMessageHeader(LEVEL_WARNING, method), 0, KDEBUG_WARN, true);
}
kdbgstream Tracer::strace(TraceLevel level, const char* method) const
{
    // return a NULL stream if the current set tracelevel is higher
    if (m_tracelevel > level) {
        return kdbgstream("", 0, KDEBUG_TRACE_LEVEL_LOOKUP_TABLE[level], false);
    }

    return kdbgstream(prepareMessageHeader(level, method), 0, KDEBUG_TRACE_LEVEL_LOOKUP_TABLE[level], true);
}
kdbgstream Tracer::serror(const char* method) const
{
    // return a NULL stream if the current set tracelevel is higher
    if (m_tracelevel > LEVEL_ERROR) {
        return kdbgstream("", 0, KDEBUG_ERROR, false);
    }
    
    return kdbgstream(prepareMessageHeader(LEVEL_ERROR, method), 0, KDEBUG_ERROR, true);
}
kdbgstream Tracer::sinvoked(const char* method) const
{
    // return a NULL stream if the current set tracelevel is higher
    if (m_tracelevel > LEVEL_INVOKED) {
        return kdbgstream("", 0, KDEBUG_INFO, false);
    }
    
    return kdbgstream(prepareMessageHeader(LEVEL_INVOKED, method), 0, KDEBUG_INFO, true);
}
void Tracer::dump(QString indention) const
{
    // print some useful infos about this tracer
    kdbgstream(indention, 0, 999, true)
            << "- "
            << *m_tracerpartname
            << " [" << TRACE_LEVEL_NAME[m_tracelevel] << "] "
            << "(classname: " << *m_classname << "), "
            << "fulltracername: " << *m_tracername
            << endl;

    // call dump on each child
    indention.append("  ");
    Tracer* child;
    for (child = m_children->first(); child; child = m_children->next()) {
        child->dump(indention);
    }
}
kdbgstream Tracer::sfatal(const char* method) const
{
    // fatal traces cannot be suppressed!
    
    return kdbgstream(prepareMessageHeader(LEVEL_FATAL, method), 0, KDEBUG_FATAL, true);
}
kdbgstream kdFatal(bool cond, int area) { if (cond) return kdbgstream("FATAL: ", area, KDEBUG_FATAL); else return kdbgstream(0,0,false); }
kdbgstream kdWarning(bool cond, int area) { if (cond) return kdbgstream("WARNING: ", area, KDEBUG_WARN); else return kdbgstream(0,0,false); }
kdbgstream kdFatal(int area) { return kdbgstream("FATAL: ", area, KDEBUG_FATAL); }
kdbgstream kdWarning(int area) { return kdbgstream("WARNING: ", area, KDEBUG_WARN); }
kdbgstream kdError(bool cond, int area) { if (cond) return kdbgstream("ERROR: ", area, KDEBUG_ERROR); else return kdbgstream(0,0,false); }
kdbgstream kdError(int area) { return kdbgstream("ERROR: ", area, KDEBUG_ERROR); }
kdbgstream kdDebug(bool cond, int area) { if (cond) return kdbgstream(area, KDEBUG_INFO); else return kdbgstream(0, 0, false); }
kdbgstream kdDebug(int area) { return kdbgstream(area, KDEBUG_INFO); }