Skip to content
Snippets Groups Projects
Unverified Commit b4a4dfea authored by Roman Azarenko's avatar Roman Azarenko
Browse files

quickjs: remove console.log calls in async-mqtt.js

console.log outputs to stdout. This breaks CLI tools, which use stdout for outputting response JSON data.

QuickJS doesn't support console.warn/console.error. Printing to stderr can be achieved with `std.err.puts()` or
`std.err.printf()`.

Alternatively, this kind of output should be put behind a verbose/debug flag.
parent 3fd75a25
No related branches found
No related tags found
2 merge requests!5Rebase with master,!4quickjs: remove console.log calls in async-mqtt.js
Pipeline #75306 passed
......@@ -18,13 +18,10 @@ class AsyncClient {
protobuf.Root.prototype.fetch = function (filename, callback) {
os.setTimeout(function () {
const data = std.loadFile(filename);
if (data === null) {
console.log("failed to load file: " + filename);
if (data === null)
callback(new Error("failed to load file: " + filename));
} else {
//console.log(`data loaded for ${filename}`)
else
callback(null, data);
}
}, 0);
};
}
......@@ -82,7 +79,6 @@ class AsyncClient {
// there is no erro handling in paho mqtt
this.client.onConnectionLost = function (responseObject) {
callback(responseObject);
console.log("USP Disconnected: ", responseObject.errorMessage);
};
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment