added debug functionality.
This commit is contained in:
parent
6490072a62
commit
499062de8c
6
index.js
6
index.js
|
@ -39,6 +39,12 @@ module.exports.create = (createOptions) => {
|
||||||
|
|
||||||
const options = Object.assign({}, defaultOptions, createOptions);
|
const options = Object.assign({}, defaultOptions, createOptions);
|
||||||
|
|
||||||
|
if (!options.debug) {
|
||||||
|
console = console || {};
|
||||||
|
console.log = () => { };
|
||||||
|
console.error = () => { };
|
||||||
|
}
|
||||||
|
|
||||||
AWS.config.update({
|
AWS.config.update({
|
||||||
region: options.bucketRegion
|
region: options.bucketRegion
|
||||||
, credentials: new AWS.Credentials({
|
, credentials: new AWS.Credentials({
|
||||||
|
|
3
test.js
3
test.js
|
@ -16,11 +16,12 @@ let store = require('./index').create({
|
||||||
, bucketName: bucketName
|
, bucketName: bucketName
|
||||||
, configDir: 'acme/'
|
, configDir: 'acme/'
|
||||||
, accountsDir: 'accounts/'
|
, accountsDir: 'accounts/'
|
||||||
|
, debug: true
|
||||||
});
|
});
|
||||||
|
|
||||||
// All of these tests can pass locally, standalone without any ACME integration.
|
// All of these tests can pass locally, standalone without any ACME integration.
|
||||||
tester.test(store).then(() => {
|
tester.test(store).then(() => {
|
||||||
console.info("Test successfully completed");
|
console.info("Test completed successfully.");
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.error(err.message);
|
console.error(err.message);
|
||||||
throw err;
|
throw err;
|
||||||
|
|
Loading…
Reference in New Issue