Beispiel #1
0
int main()
{
  TraceToConsole();

  TF0("This to output.");

  char fileName[] = "log.txt";
  TraceToFile(fileName);

  TF1("Tracing was switched to file %s", fileName); 

  TraceToConsole();

  TraceExclude("test.cpp");

  TF0("This won't be seen, test.cpp was excluded");
}
int Domain::NObjLogManager::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    typedef Domain::NamedObject QMocSuperClass;
    _id = QMocSuperClass::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: Clear(); break;
        case 1: Log((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 2: DumpSessionsToFile((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 3: DumpSessionsToFile(); break;
        default: ;
        }
        _id -= 4;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = TraceToCout(); break;
        case 1: *reinterpret_cast< bool*>(_v) = TraceToFile(); break;
        case 2: *reinterpret_cast< QString*>(_v) = FileName(); break;
        case 3: *reinterpret_cast< bool*>(_v) = DirectSaveToFile(); break;
        case 4: *reinterpret_cast< bool*>(_v) = TraceToUdp(); break;
        case 5: *reinterpret_cast< QString*>(_v) = DstUdpTrace(); break;
        case 6: *reinterpret_cast< bool*>(_v) = TimestampInd(); break;
        case 7: *reinterpret_cast< int*>(_v) = CountToSync(); break;
        case 8: *reinterpret_cast< int*>(_v) = TimeoutToSync(); break;
        case 9: *reinterpret_cast< int*>(_v) = StoreRecordsLimit(); break;
        case 10: *reinterpret_cast< int*>(_v) = StoreCleanTo(); break;
        case 11: *reinterpret_cast< QString*>(_v) = PathSeparator(); break;
        case 12: *reinterpret_cast< QString*>(_v) = Stat(); break;
        }
        _id -= 13;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: TraceToCout(*reinterpret_cast< bool*>(_v)); break;
        case 1: TraceToFile(*reinterpret_cast< bool*>(_v)); break;
        case 2: FileName(*reinterpret_cast< QString*>(_v)); break;
        case 3: DirectSaveToFile(*reinterpret_cast< bool*>(_v)); break;
        case 4: TraceToUdp(*reinterpret_cast< bool*>(_v)); break;
        case 5: DstUdpTrace(*reinterpret_cast< QString*>(_v)); break;
        case 6: TimestampInd(*reinterpret_cast< bool*>(_v)); break;
        case 7: CountToSync(*reinterpret_cast< int*>(_v)); break;
        case 8: TimeoutToSync(*reinterpret_cast< int*>(_v)); break;
        case 9: StoreRecordsLimit(*reinterpret_cast< int*>(_v)); break;
        case 10: StoreCleanTo(*reinterpret_cast< int*>(_v)); break;
        case 11: PathSeparator(*reinterpret_cast< QString*>(_v)); break;
        }
        _id -= 13;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 13;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 13;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}