From cad9d22009e22cd5fada8f21d1eb01550ec0dc4b Mon Sep 17 00:00:00 2001 From: Tim Robinson Date: Thu, 24 Mar 2016 14:18:26 +0000 Subject: [PATCH] Remove logging from fs, might slow down vfs too much --- plugins/c9.fs/fs.js | 7 +++---- plugins/c9.fs/fs.streams.js | 6 +----- plugins/c9.fs/fs.xhr.js | 7 +------ 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/plugins/c9.fs/fs.js b/plugins/c9.fs/fs.js index 5cf6eb30..f07b7746 100644 --- a/plugins/c9.fs/fs.js +++ b/plugins/c9.fs/fs.js @@ -10,17 +10,16 @@ */ //@todo might have to add queueing for safe operations define(function(require, exports, module) { - main.consumes = ["vfs", "Plugin", "auth", "vfs.log"]; + main.consumes = ["vfs", "Plugin", "auth"]; main.provides = ["fs"]; return main; function main(options, imports, register) { var vfs = imports.vfs; - var logger = imports["vfs.log"]; var Plugin = imports.Plugin; - var stream = require("./fs.streams")(vfs, options.base, options.baseProc, options.cli, logger); - var xhr = options.cli ? stream : require("./fs.xhr")(vfs.rest, logger); + var stream = require("./fs.streams")(vfs, options.base, options.baseProc, options.cli); + var xhr = options.cli ? stream : require("./fs.xhr")(vfs.rest); var uCaseFirst = require("c9/string").uCaseFirst; var normalize = require("path").normalize; diff --git a/plugins/c9.fs/fs.streams.js b/plugins/c9.fs/fs.streams.js index 69127f71..19a5fbfe 100644 --- a/plugins/c9.fs/fs.streams.js +++ b/plugins/c9.fs/fs.streams.js @@ -3,7 +3,7 @@ define(function(require, exports, module) { var Stream = require("stream").Stream; var PATH = require("path"); -return function(vfs, base, baseProc, cli, logger) { +return function(vfs, base, baseProc, cli) { var resolvePath = function(path, basePath) { if (path.charAt(0) == "~") { @@ -33,8 +33,6 @@ return function(vfs, base, baseProc, cli, logger) { if (encoding) options.encoding = encoding; - logger.log("[vfs.stream] Reading file " + path); - vfs.readfile(resolvePath(path), options, function(err, meta) { if (err) return callback(err); @@ -72,8 +70,6 @@ return function(vfs, base, baseProc, cli, logger) { var stream = options.stream = new Stream(); stream.readable = true; - logger.log("[vfs.stream] Writing file " + path); - vfs.mkfile(resolvePath(path), options, function(err, meta) { if (err) return callback(err); diff --git a/plugins/c9.fs/fs.xhr.js b/plugins/c9.fs/fs.xhr.js index 2691506c..69020713 100644 --- a/plugins/c9.fs/fs.xhr.js +++ b/plugins/c9.fs/fs.xhr.js @@ -1,10 +1,9 @@ define(function (require, exports, module) { "use strict"; -return function(_request, logger) { +return function(_request) { function request(method, path, body, callback, progress, sync, headers) { - // This goes to rest() function in vfs_client.js return _request(path, { method: method, body: body, @@ -32,8 +31,6 @@ return function(_request, logger) { return callback(err); } - logger.log("[vfs.xhr] Reading file " + path); - var headers = metadata ? { "x-request-metadata" : "true" } : null; return request("GET", path, "", function(err, data, res) { if (err) @@ -80,8 +77,6 @@ return function(_request, logger) { // It would then be interpreted as a directory if (path.substr(-1) == "/") path = path.substr(0, path.length - 1); - - logger.log("[vfs.xhr] Writing file " + path); return request("PUT", path, data, callback, progress, sync); }