// just a simple logging library
// set DEBUG to a non-empty string to see logging

'use strict';

const metadata = require('../package.json');

if (process.env.DEBUG) {
  log(`starting v${metadata.version} at ${new Date()}`);
}

function log() {
  if (process.env.DEBUG) {
    const logMessages = [`${metadata.name}:`].concat([].slice.call(arguments));
    console.log.apply(console, logMessages);
  }
}

module.exports = log;

@@ -138,16 +138,26 @@
 son');%0A%0A
+let log;%0A%0A
 if (proc
@@ -182,80 +182,21 @@
  log
-(%60starting v$%7Bmetadata.version%7D at $%7Bnew Date()%7D%60);%0A%7D%0A%0Afunction log()
+ = () =%3E
  %7B%0A
+  
   if
@@ -218,16 +218,18 @@
 EBUG) %7B%0A
+  
     cons
@@ -300,24 +300,26 @@
 ents));%0A    
+ 
+ 
 console.log.
@@ -353,11 +353,101 @@
 ;%0A  
-%7D%0A%7D
+  %7D%0A  %7D;%0A%7D else %7B%0A  log = () =%3E %7B%7D;%0A%7D%0A%0Alog(%60starting v$%7Bmetadata.version%7D at $%7Bnew Date()%7D%60);
 %0A%0Amo

use noop function when not logging