Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit cfc4f3f

Browse files
Relax configuration rules for agent (#245)
With this change, we will use the option object for agent configuation if options.debug does not exist. PR-URL: #245
1 parent 8358f67 commit cfc4f3f

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/agent/debuglet.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,7 @@ Debuglet.normalizeConfig_ = function(config) {
155155
}
156156
};
157157

158-
config = extend(true, {}, defaultConfig, config, envConfig);
159-
160-
if (config.keyFilename || config.credentials || config.projectId) {
161-
throw new Error('keyFilename, projectId or credentials should be provided' +
162-
' to the Debug module constructor rather than startAgent');
163-
}
164-
165-
return config;
158+
return extend(true, {}, defaultConfig, config, envConfig);
166159
};
167160

168161
/**

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ var debuglet;
3838
*/
3939
function start(options) {
4040
options = options || {};
41-
var agentConfig = options.debug || {};
41+
var agentConfig = options.debug || options;
4242

4343
// forceNewAgent_ is for testing purposes only.
4444
if (debuglet && !agentConfig.forceNewAgent_) {
45-
throw new Error('Debug Agent has already been starterd');
45+
throw new Error('Debug Agent has already been started');
4646
}
4747

4848
var debug = new Debug(options);

0 commit comments

Comments
 (0)