/**
 * pubfood
 * Copyright (c) 2015 Yieldbot, Inc. - All rights reserved.
 */

'use strict';

/**
 *
 * @type {Array}
 */
var history = [];

/**
 * console.logs the history
 * @return {undefined}
 */
var dumpLog = function(){
  if(console && console.log){
    for (var i = 0; i < history.length; i++) {
      console.log(history[i]);
    }
  }
};

/**
 * logs api calls
 *
 * @param {string} name
 * @param {array} args
 * @return {function}
 */
var logCall = function(name, args) {
  history.push({
    functionName: name,
    args: Array.prototype.slice.call(args)
  });
};

module.exports = {
  history: history,
  logCall: logCall,
  dumpLog: dumpLog
};

@@ -92,19 +92,16 @@
 ';%0A%0A/**%0A
- *%0A
  * @type
@@ -106,108 +106,368 @@
 pe %7B
-Array%7D%0A */%0Avar history = %5B%5D;%0A%0A/**%0A * console.logs the history%0A * @return %7Bundefined%7D%0A */%0Avar
+object%7D%0A * @name Logger%0A * @property %7Barray%7D history Store the logs%0A * @property %7Bfunction%7D dumpLog console.logs the history%0A * @property %7Bfunction%7D logCall Logs every time a given function is called%0A * @property %7Bstring%7D logCall.name The function name%0A * @property %7Barray%7D logCall.args The function arguments to log%0A */%0Avar logger = %7B%0A  history: %5B%5D,%0A 
  dumpLog
  = f
@@ -462,18 +462,17 @@
  dumpLog
- =
+:
  functio
@@ -478,14 +478,18 @@
 on()
+ 
 %7B%0A  
+  
 if
+ 
 (con
@@ -508,22 +508,25 @@
 ole.log)
+ 
 %7B%0A    
+  
 for (var
@@ -537,16 +537,23 @@
  0; i %3C 
+logger.
 history.
@@ -573,16 +573,18 @@
 %7B%0A      
+  
 console.
@@ -587,16 +587,23 @@
 ole.log(
+logger.
 history%5B
@@ -615,127 +615,32 @@
     
-%7D%0A
   %7D%0A
-%7D;%0A%0A/**%0A * logs api calls%0A *%0A * @param %7Bstring%7D name%0A * @param %7Barray%7D args%0A * @return %7Bfunction%7D%0A */%0Avar
+    %7D%0A  %7D,%0A 
  logCall
  = f
@@ -635,18 +635,17 @@
  logCall
- =
+:
  functio
@@ -660,16 +660,18 @@
 args) %7B%0A
+  
   histor
@@ -683,16 +683,18 @@
 h(%7B%0A    
+  
 function
@@ -705,16 +705,18 @@
 : name,%0A
+  
     args
@@ -754,14 +754,20 @@
 gs)%0A
+  
   %7D);%0A
+  %7D%0A
 %7D;%0A%0A
@@ -787,68 +787,12 @@
 s = 
-%7B%0A  history: history,%0A  logCall: logCall,%0A  dumpLog: dumpLog%0A%7D
+logger
 ;%0A

update logger docs