Skip to content

Commit

Permalink
Remove trace property from config (#420)
Browse files Browse the repository at this point in the history
PR-URL: #420
  • Loading branch information
matthewloring authored Feb 27, 2017
1 parent bfa1d4e commit 2617526
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
2 changes: 0 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ var path = require('path');

// Default configuration
module.exports = {
trace: {
// Log levels: 0-disabled,1-error,2-warn,3-info,4-debug
logLevel: 1,

Expand Down Expand Up @@ -124,5 +123,4 @@ module.exports = {
// For testing purposes only.
// Used by unit tests to force loading of a new agent if one exists already.
forceNewAgent_: false
}
};
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var initConfig = function(projectConfig) {
logLevel: process.env.GCLOUD_TRACE_LOGLEVEL,
projectId: process.env.GCLOUD_PROJECT
};
var config = extend(true, {}, require('./config.js').trace, projectConfig, envConfig);
var config = extend(true, {}, require('./config.js'), projectConfig, envConfig);
if (config.maximumLabelValueSize > constants.TRACE_SERVICE_LABEL_VALUE_LIMIT) {
config.maximumLabelValueSize = constants.TRACE_SERVICE_LABEL_VALUE_LIMIT;
}
Expand Down
8 changes: 3 additions & 5 deletions test/fixtures/test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
'use strict';

module.exports = {
trace: {
logLevel: 4,
stackTraceLimit: 1,
flushDelaySeconds: 31
}
logLevel: 4,
stackTraceLimit: 1,
flushDelaySeconds: 31
};

8 changes: 3 additions & 5 deletions test/fixtures/test-config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"trace": {
"logLevel": 4,
"stackTraceLimit": 1,
"flushDelaySeconds": 31
}
"logLevel": 4,
"stackTraceLimit": 1,
"flushDelaySeconds": 31
}
2 changes: 1 addition & 1 deletion test/test-trace-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var extend = require('extend');
var TraceAPI = require('../src/trace-api.js');
var TracingPolicy = require('../src/tracing-policy.js');

var config = extend({}, require('../config.js').trace,
var config = extend({}, require('../config.js'),
{ samplingRate: 0, projectId: '0' });
var logger = require('@google-cloud/common').logger();
var agent = require('../src/trace-agent.js').get(config, logger);
Expand Down

0 comments on commit 2617526

Please sign in to comment.