var fs = require('fs');

var cache_path = 'cache/';

function BasicStorage (options) {
  if ('cache_path' in options) {
    cache_path = options.cache_path;
  }
  fs.stat(cache_path, function (err, stats) {
    if (err) {
      console.error(err.message);
    }
    if (!stats || !stats.isDirectory()) {
      console.log('create directory : ' + cache_path);
      fs.mkdir(cache_path, 0664);
    }
  });
}

BasicStorage.prototype.get = function(key, cb) {
  fs.stat(cache_path + key, function (err, stats) {
    if (err) {
      console.error(err.message);
    }
    if (stats && stats.isFile()) {
      console.log('get : ' + key);
      fs.readFile(cache_path + key, cb);
      return;
    }
    cb(null, false);
  });
};

BasicStorage.prototype.set = function(key, content, cb) {
  console.log('set : ' + key);
  fs.writeFile(cache_path + key, content, 'binary', cb);
};

BasicStorage.prototype.remove = function(key, cb) {
  fs.stat(cache_path + key, function (err, stats) {
    if (err) {
      return console.error(err.message);
    }
    if (stats && stats.isFile()) {
      console.log('remove : ' + key);
      fs.unlink(cache_path + key, cb);
    }
  });
};

exports = module.exports = BasicStorage;
@@ -596,43 +596,8 @@
 ) %7B%0A
-      console.log('get : ' + key);%0A
     
@@ -746,39 +746,8 @@
 ) %7B%0A
-  console.log('set : ' + key);%0A
   fs
@@ -1008,46 +1008,8 @@
 ) %7B%0A
-      console.log('remove : ' + key);%0A
     

remove useless logs