mavensmate
Version:
Core APIs that drive MavensMate IDEs for Salesforce1/Force.com
46 lines (40 loc) • 1.28 kB
JavaScript
/**
* @file Deletes trace flags for all user ids in the config/.debug file created by the running user
* @author Joseph Ferraro <@joeferraro>
*/
;
var Promise = require('bluebird');
var inherits = require('inherits');
var BaseCommand = require('../../command');
var moment = require('moment');
function Command() {
Command.super_.call(this, Array.prototype.slice.call(arguments, 0));
}
inherits(Command, BaseCommand);
Command.prototype.execute = function() {
var self = this;
return new Promise(function(resolve, reject) {
var project = self.getProject();
var sfdcClient = project.sfdcClient;
var projectDebugSettings = project.getDebugSettingsSync();
sfdcClient.stopLogging(projectDebugSettings.users)
.then(function() {
resolve('Stopped logging for debug users');
})
.catch(function(error) {
reject(error);
})
.done();
});
};
exports.command = Command;
exports.addSubCommand = function(program) {
program
.command('stop-logging')
.description('Stops logging Apex execution for all user ids listed in your project\'s config/.debug file')
.action(function(/* Args here */){
program.commandExecutor.execute({
name: this._name
});
});
};