// TODO: To decide and adopt to some logging utility like winston
var util = require('util');

module.exports = {
  info: function(message,context) {
    if(context) {
      console.log(message, util.format('%j', context));
    }
    else {
      console.log(message);
    }
    
  },
  error: function(message, error) {
    console.error(message, util.format('%j', error));
  }
};

// TODO: To decide and adopt to some logging utility like winston
module.exports = {
  info: function(message,context) {
    if(context) {
      console.log(message,JSON.stringify(context, null, 2));
    }
    else {
      console.log(message);
    }
    
  },
  error: function(message, error) {
    console.error(message, JSON.stringify(error, null, 2));
  }
};

--- 
+++ 
@@ -1,10 +1,8 @@
 // TODO: To decide and adopt to some logging utility like winston
-var util = require('util');
-
 module.exports = {
   info: function(message,context) {
     if(context) {
-      console.log(message, util.format('%j', context));
+      console.log(message,JSON.stringify(context, null, 2));
     }
     else {
       console.log(message);
@@ -12,6 +10,6 @@
     
   },
   error: function(message, error) {
-    console.error(message, util.format('%j', error));
+    console.error(message, JSON.stringify(error, null, 2));
   }
 };
Fix multi-line log output in app logs
