title: What is the most elegant and efficient way to log obd data?
body: <p>So I have a poller that polls a device for a response that looks like this:</p>
  
  <p><code>{"mode":"41","pid":"0C","name":"rpm","value":1817.75}</code></p>
  
  <p>I have multiple pollers with similar responses. Say, another poller with the following response:</p>
  
  <p><code>{"mode":"41","pid":"05","name":"temp","value":81}</code></p>
  
  <p>Each poll takes place in a 500ms interval. I need to log all this data in a certain form.</p>
  
  <p><strong>What happens now?</strong>
  <br><br>
  I have a log that looks like this:</p>
  
  <pre><code>{"data": {"mode":"41","pid":"0C","name":"rpm","value":1817.75}, "time": "someTime" },
  {"data": {"mode":"41","pid":"05","name":"temp","value":81}, "time": "someOtherTime" }
  </code></pre>
  
  <p><strong>What I'm trying to achieve?</strong>
  <br><br>
  A log that looks like this:</p>
  
  <pre><code>{ 
    "data": {
              "rpm": {"mode":"41","pid":"0C","name":"rpm","value":1817.75},
              "temp":{"mode":"41","pid":"05","name":"temp","value":81},
              "time": newTime
            },
   "data": {
              "rpm": {"mode":"41","pid":"0C","name":"rpm","value":1817.75},
              "temp":{"mode":"41","pid":"05","name":"temp","value":81},
              "time": newTime
            },
   "data": {
              "rpm": {"mode":"41","pid":"0C","name":"rpm","value":1817.75},
              "temp":{"mode":"41","pid":"05","name":"temp","value":81},
              "time": newTime
            },
  }
  </code></pre>
  
  <p>I need to construct the object to look like the way I've mentioned. I'm sure there's a simple way to do it. Also, if there's a better way to do it, what would it be?</p>