cleanup warnings and allow setting "unknown" debug categories
This commit is contained in:
parent
25152c5e27
commit
ec15e664e1
@ -34,9 +34,7 @@ bool JsonValidator::checkRefs(const QVariantMap &map, const QVariantMap &api)
|
||||
QVariantMap enums = api.value("enums").toMap();
|
||||
QVariantMap flags = api.value("flags").toMap();
|
||||
QVariantMap types = api.value("types").toMap();
|
||||
// qWarning() << "checkrefs enums" << enums.keys();
|
||||
foreach (const QString &key, map.keys()) {
|
||||
// qWarning() << "checking prop" << key << types.keys();
|
||||
if (map.value(key).toString().startsWith("$ref:")) {
|
||||
QString refName = map.value(key).toString().remove("$ref:");
|
||||
if (!enums.contains(refName) && !flags.contains(refName) && !types.contains(refName)) {
|
||||
|
||||
@ -253,7 +253,6 @@ JsonReply *RulesHandler::GetRuleDetails(const QVariantMap ¶ms)
|
||||
JsonReply* RulesHandler::AddRule(const QVariantMap ¶ms)
|
||||
{
|
||||
Rule rule = unpack<Rule>(params);
|
||||
qWarning() << "Unpacked rule" << rule;
|
||||
rule.setId(RuleId::createRuleId());
|
||||
|
||||
RuleEngine::RuleError status = NymeaCore::instance()->ruleEngine()->addRule(rule);
|
||||
|
||||
@ -173,7 +173,7 @@ void NymeaCore::init() {
|
||||
m_cloudManager = new CloudManager(m_configuration, m_networkManager, this);
|
||||
|
||||
qCDebug(dcApplication()) << "Loading experiences";
|
||||
new ExperienceManager(m_deviceManager, m_serverManager->jsonServer(), this);
|
||||
m_experienceManager = new ExperienceManager(m_deviceManager, m_serverManager->jsonServer(), this);
|
||||
|
||||
|
||||
CloudNotifications *cloudNotifications = m_cloudManager->createNotificationsPlugin();
|
||||
|
||||
@ -54,6 +54,7 @@ class TagsStorage;
|
||||
class UserManager;
|
||||
class Platform;
|
||||
class System;
|
||||
class ExperienceManager;
|
||||
|
||||
class NymeaCore : public QObject
|
||||
{
|
||||
@ -134,6 +135,7 @@ private:
|
||||
NetworkManager *m_networkManager;
|
||||
UserManager *m_userManager;
|
||||
System *m_system;
|
||||
ExperienceManager *m_experienceManager;
|
||||
|
||||
QList<RuleId> m_executingRules;
|
||||
|
||||
|
||||
@ -389,8 +389,6 @@ StateEvaluators::StateEvaluators(const QList<StateEvaluator> &other): QList<Stat
|
||||
|
||||
QVariant StateEvaluators::get(int index) const
|
||||
{
|
||||
qWarning() << "getting" << index << "of" << count();
|
||||
qWarning() << "at" << at(index);
|
||||
return QVariant::fromValue(at(index));
|
||||
}
|
||||
|
||||
|
||||
@ -292,6 +292,5 @@ QVariant CalendarItems::get(int index) const
|
||||
|
||||
void CalendarItems::put(const QVariant &variant)
|
||||
{
|
||||
qWarning() << "Putting!" << variant;
|
||||
append(variant.value<CalendarItem>());
|
||||
}
|
||||
|
||||
@ -208,11 +208,11 @@ int main(int argc, char *argv[])
|
||||
bool isWarning = debugArea.endsWith("Warnings");
|
||||
debugArea.remove(QRegExp("^No"));
|
||||
debugArea.remove(QRegExp("Warnings$"));
|
||||
if (loggingFilters.contains(debugArea) || loggingFiltersPlugins.contains(debugArea)) {
|
||||
loggingRules.append(QString("%1.%2=%3").arg(debugArea).arg(isWarning ? "warning" : "debug").arg(enable ? "true": "false"));
|
||||
} else {
|
||||
qCWarning(dcApplication) << QCoreApplication::translate("nymea", "No such debug category:") << debugArea;
|
||||
}
|
||||
loggingRules.append(QString("%1.%2=%3").arg(debugArea).arg(isWarning ? "warning" : "debug").arg(enable ? "true": "false"));
|
||||
// if (loggingFilters.contains(debugArea) || loggingFiltersPlugins.contains(debugArea)) {
|
||||
// } else {
|
||||
// qCWarning(dcApplication) << QCoreApplication::translate("nymea", "No such debug category:") << debugArea;
|
||||
// }
|
||||
}
|
||||
|
||||
// Finally set the rules for the logging
|
||||
|
||||
@ -3010,7 +3010,6 @@ void TestRules::testLoopingRules()
|
||||
addRuleParams.insert("eventDescriptors", QVariantList() << offEvent);
|
||||
addRuleParams.insert("actions", QVariantList() << onAction);
|
||||
QVariant response = injectAndWait("Rules.AddRule", addRuleParams);
|
||||
qWarning() << response;
|
||||
verifyRuleError(response);
|
||||
|
||||
// Add rule 1
|
||||
|
||||
@ -259,8 +259,6 @@ void TestTimeManager::loadSaveTimeDescriptor()
|
||||
.arg(QString(QJsonDocument::fromVariant(timeDescriptorMapLoaded).toJson()))
|
||||
.toUtf8());
|
||||
|
||||
// qWarning() << "+++" << QString(QJsonDocument::fromVariant(timeDescriptorMap).toJson());
|
||||
// qWarning() << "---" << QString(QJsonDocument::fromVariant(timeDescriptorMapLoaded).toJson());
|
||||
// REMOVE rule
|
||||
QVariantMap removeParams;
|
||||
removeParams.insert("ruleId", ruleId);
|
||||
@ -2087,7 +2085,6 @@ void TestTimeManager::verifyRuleNotExecuted()
|
||||
QCOMPARE(spy.count(), 1);
|
||||
|
||||
QByteArray actionHistory = reply->readAll();
|
||||
qWarning() << "actionHistory" << actionHistory;
|
||||
QVERIFY2(actionHistory.isEmpty(), "Actfdsfadsion is triggered while it should not have been.");
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user