sparkfun / phant

the data logging engine behind data.sparkfun.com
700 stars 98 forks source link

Stderr duplication bug #236

Closed sthgrau closed 6 years ago

sthgrau commented 7 years ago

I noticed that the output to stderr was duplicated. I tracked it down to the validator, where the incoming data is printed once for every data field. I don't see that the data is changed at all within that loop, so there is no need to keep printing it out. It is also not immediately usable json, so I added a stringify. Patch below.

index 8f877c4..966bd51 100644
--- a/lib/validator.js
+++ b/lib/validator.js
@@ -168,8 +168,8 @@ app.fields = function(id, data, callback) {
     stream.fields.push('timestamp');

     // make sure all keys are valid
+    console.log(JSON.stringify(data,null,'\t'));
     for (var key in data) {
-      console.log(data);
       if (!Object.prototype.hasOwnProperty.call(data, key)) {
         continue;
       }
bboyho commented 6 years ago

Phant is No Longer in Operation

Unfortunately Phant, our data-streaming service, is no longer in service and will be discontinued. The system has reached capacity and, like a less-adventurous Cassini, has plunged conclusively into a fiery and permanent retirement. There are several other maker-friendly, data-streaming services and/or IoT platforms available as alternatives. The three we recommend are Blynk, ThingSpeak, and Cayenne. You can read our blog post [ https://www.sparkfun.com/news/2413 ] on the topic for an overview and helpful links for each platform.