Moved the curl formatting into the log and changed the arguments for the log event listeneres to

receive both the "message" and the "curlCommand".

Added a "tracer" logger which allows you to create log files that a executable scripts. Those scripts
will write all of the log messages as script comments, and not comment out the curlCommands, so that they
can trace their application and use the generated script to recreate the issue.

Most changes are simply cased by adding the "unused" rule to jshint.
This commit is contained in:
Spencer Alger
2013-11-15 19:10:45 -07:00
parent 20804bb5ab
commit 5bb70fbe58
32 changed files with 185 additions and 229 deletions

View File

@ -64,7 +64,7 @@ function transformFile(entry) {
}
var urls = _.difference(def.url.paths, aliases[name]);
urls = _.map(urls, function (url, i) {
urls = _.map(urls, function (url) {
var optionalVars = {};
var requiredVars = {};
var param;

View File

@ -1,21 +1,14 @@
var _ = require('../../../src/lib/utils');
var asset = require('assert');
var path = require('path');
var fs = require('fs');
var mkdirp = require('mkdirp');
var templates = require('./templates');
var clean = require('../../clean');
var restSpecUpdated = require('../../rest_spec_updated');
var urlParamRE = /\{(\w+)\}/g;
var outputPath = _.joinPath(__dirname, '../../../src/lib/api.js');
var docOutputPath = _.joinPath(__dirname, '../../../docs/api.md');
var lastFetchTmp = path.join(__dirname, './last_fetch.tmp');
function download() {
require('./actions').on('ready', function (actions) {
var defs = [];
var namespaces = _.filter(_.map(actions, function (action) {
if (~action.location.indexOf('.')) {
var path = action.location.split('.').slice(0, -1);

View File

@ -1,8 +1,6 @@
/* jshint maxlen: false */
var ca = require('./client_action');
var errors = require('./errors');
var api = module.exports = {};
api._namespaces = <%= stringify(namespaces) %>;<%

View File

@ -4,48 +4,6 @@ var fs = require('fs');
var path = require('path');
/**
* Simple manager to take care of indentation
* @param {number} i - Width of the indentation
* @return {function} - Call this to add a new line to the output
*/
function lines(i) {
function l(line) {
if (line === '') {
// no indent on empty lines
l.lines.push('');
} else if (line === void 0) {
l.lines.push(_.repeat(' ', l.indent) + line);
}
return l;
}
l.lines = [];
l.indent = i || 0;
l.split = function (toSplit) {
_.each(toSplit.split(/\r?\n/), l);
return l;
};
l.in = function (line) {
l.indent += 2;
return l(line);
};
l.out = function (line) {
l.indent -= 2;
return l(line);
};
l.toString = function () {
return l.lines.join('\n');
};
return l;
}
/**
* we want strings in code to use single-quotes, so this will JSON encode vars, but then
* modify them to follow our code standards.

View File

@ -45,7 +45,6 @@ if (argv.host) {
}
var client = new es.Client(clientConfig);
var log = client.config.log;
console.log('Generating', count, 'events across ±', days, 'days');

View File

@ -1,10 +1,9 @@
var _ = require('../../../../src/lib/utils'),
WeightedList = require('./weighted_list'),
RandomList = require('./random_list'),
IpGenerator = require('./ip_generator'),
Stochator = require('./stochator'),
moment = require('moment'),
dayMs = 86400000;
var _ = require('../../../../src/lib/utils');
var WeightedList = require('./weighted_list');
var RandomList = require('./random_list');
var IpGenerator = require('./ip_generator');
var Stochator = require('./stochator');
var dayMs = 86400000;
exports.make = function (startingMoment, endingMoment) {

View File

@ -4,8 +4,6 @@
module.exports = RandomList;
var _ = require('../../../../src/lib/utils');
function RandomList(list) {
this.get = function () {
return list[Math.round(Math.random() * list.length)];

View File

@ -7,7 +7,6 @@ var path = require('path');
var jsYaml = require('js-yaml');
var spec = require('../../get_spec');
var clean = require('../../clean');
var _ = require('../../../src/lib/utils');
var restSpecUpdated = require('../../rest_spec_updated');
var testFile = path.resolve(__dirname, '../../../test/integration/yaml_suite/yaml_tests.json');