This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric/native/native_log.h

25 lines
507 B
C
Raw Normal View History

2019-12-04 15:51:46 +08:00
#ifndef NATIVELOG_H
#define NATIVELOG_H
#include <QObject>
#include <QDebug>
class NativeLog : public QObject {
Q_OBJECT
public:
NativeLog(QObject *parent = nullptr) : QObject(parent) {}
Q_INVOKABLE void function(QString level, QString content) {
if (level == 'w') {
qWarning() << content;
} else if (level == 'd') {
qDebug() << content;
} else if (level == 'e') {
qCritical() << content;
}
}
};
#endif // NATIVELOG_H