6#include <ossia_export.h>
17struct websocket_threaded_connection;
18struct websocket_heartbeat;
21class OSSIA_EXPORT qml_logger :
public QObject
35 W_ENUM(
log_level, Trace, Debug, Info, Warning, Error, Critical)
40 static qml_logger& instance();
41 QString appName()
const;
42 QString appVersion()
const;
43 QString appCreator()
const;
44 QString loggerHost()
const;
45 QStringList logFilter()
const;
47 bool logQtMessages()
const;
49 quint32 heartbeat()
const;
54 void appNameChanged(QString appName) E_SIGNAL(OSSIA_EXPORT, appNameChanged, appName);
55 void appVersionChanged(QString appVersion)
56 E_SIGNAL(OSSIA_EXPORT, appVersionChanged, appVersion);
57 void appCreatorChanged(QString appCreator)
58 E_SIGNAL(OSSIA_EXPORT, appCreatorChanged, appCreator);
59 void loggerHostChanged(QString loggerHost)
60 E_SIGNAL(OSSIA_EXPORT, loggerHostChanged, loggerHost);
61 void logQtMessagesChanged(
bool logQtMessages)
62 E_SIGNAL(OSSIA_EXPORT, logQtMessagesChanged, logQtMessages);
63 void heartbeatChanged(quint32 heartbeat)
64 E_SIGNAL(OSSIA_EXPORT, heartbeatChanged, heartbeat);
66 E_SIGNAL(OSSIA_EXPORT, logLevelChanged, logLevel);
67 void logFilterChanged(
const QStringList& logFilter)
68 E_SIGNAL(OSSIA_EXPORT, logFilterChanged, logFilter);
69 void filteredLog(
int type,
const QString& fileName,
int line,
const QString& msg)
70 E_SIGNAL(OSSIA_EXPORT, filteredLog, type, fileName, line, msg);
74 W_SLOT(connectLogger);
75 void disconnectLogger();
76 W_SLOT(disconnectLogger);
78 void setAppName(QString appName);
80 void setAppVersion(QString appVersion);
81 W_SLOT(setAppVersion);
82 void setAppCreator(QString appCreator);
83 W_SLOT(setAppCreator);
85 void trace(
const QString& s);
87 void info(
const QString& s);
89 void debug(
const QString& s);
91 void warning(
const QString& s);
93 void error(
const QString& s);
97 void setLoggerHost(QString loggerHost);
98 W_SLOT(setLoggerHost);
99 void setLogQtMessages(
bool logQtMessages);
100 W_SLOT(setLogQtMessages);
101 void setLogFilter(QStringList logFilter);
102 W_SLOT(setLogFilter);
104 void setHeartbeat(quint32 heartbeat);
105 W_SLOT(setHeartbeat);
109 void startHeartbeat(QVariantMap);
110 W_SLOT(startHeartbeat);
113 std::shared_ptr<websocket_threaded_connection> m_ws;
114 std::shared_ptr<spdlog::logger> m_logger;
115 std::shared_ptr<websocket_heartbeat> m_heartbeat;
118 QString m_appVersion;
119 QString m_appCreator;
120 QString m_loggerHost;
121 QStringList m_logFilter;
123 quint32 m_heartbeatDur{5};
125 bool m_logQtMessages{};
128 QStringList, logFilter READ logFilter WRITE setLogFilter NOTIFY logFilterChanged)
130 W_PROPERTY(
log_level, logLevel READ logLevel WRITE setLogLevel NOTIFY logLevelChanged)
133 bool, logQtMessages READ logQtMessages WRITE setLogQtMessages NOTIFY
134 logQtMessagesChanged)
137 quint32, heartbeat READ heartbeat WRITE setHeartbeat NOTIFY heartbeatChanged)
140 QString, loggerHost READ loggerHost WRITE setLoggerHost NOTIFY loggerHostChanged)
143 QString, appCreator READ appCreator WRITE setAppCreator NOTIFY appCreatorChanged,
147 QString, appVersion READ appVersion WRITE setAppVersion NOTIFY appVersionChanged,
151 QString, appName READ appName WRITE setAppName NOTIFY appNameChanged, W_Final)
155W_REGISTER_ARGTYPE(ossia::qt::qml_logger::log_level)
log_level
Definition ossia-c.h:1637
spdlog::logger & logger() noexcept
Where the errors will be logged. Default is stderr.
Definition context.cpp:118
bool critical
Means that the node is very important, e.g. a "play" message.
Definition node_attributes.hpp:92