Skip to content

Commit

Permalink
Add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
brizental committed Jan 30, 2023
1 parent 04387a9 commit 53d8e76
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ Logger logger("AddonConditionWatcherJavascript");
// static
AddonConditionWatcher* AddonConditionWatcherJavascript::maybeCreate(
Addon* addon, const QString& javascript) {
logger.debug() << "Attempting to create JavaScript condition watcher from" << javascript;

if (javascript.isEmpty()) {
logger.debug() << "Provided JavaScript file is empty. Ignoring.";
return nullptr;
}

Expand Down Expand Up @@ -59,6 +62,7 @@ AddonConditionWatcherJavascript::AddonConditionWatcherJavascript(
QJSValue api = engine->newQObject(addon->api());
QJSValue self = engine->newQObject(this);

logger.debug() << "Executing JavaScript condition";
QJSValue output = function.call(QJSValueList{api, self});
if (output.isError()) {
logger.debug() << "Execution of the watcher function failed"
Expand Down

0 comments on commit 53d8e76

Please sign in to comment.