From 499062de8c3b5015f43d9cb43c6028966a99b893 Mon Sep 17 00:00:00 2001 From: Cyrille Date: Wed, 8 May 2019 14:15:46 +0100 Subject: [PATCH] added debug functionality. --- index.js | 6 ++++++ test.js | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c0e47df..6f591cd 100644 --- a/index.js +++ b/index.js @@ -39,6 +39,12 @@ module.exports.create = (createOptions) => { const options = Object.assign({}, defaultOptions, createOptions); + if (!options.debug) { + console = console || {}; + console.log = () => { }; + console.error = () => { }; + } + AWS.config.update({ region: options.bucketRegion , credentials: new AWS.Credentials({ diff --git a/test.js b/test.js index efc8465..7d732f6 100644 --- a/test.js +++ b/test.js @@ -16,11 +16,12 @@ let store = require('./index').create({ , bucketName: bucketName , configDir: 'acme/' , accountsDir: 'accounts/' + , debug: true }); // All of these tests can pass locally, standalone without any ACME integration. tester.test(store).then(() => { - console.info("Test successfully completed"); + console.info("Test completed successfully."); }).catch((err) => { console.error(err.message); throw err;