2
0
mirror of https://github.com/cderche/greenlock-challenge-s3 synced 2025-05-10 15:36:33 +00:00

Log only on debug

This commit is contained in:
Cyrille 2019-05-08 17:51:29 +01:00
parent d95a4bb6a9
commit f7d07cceea

View File

@ -13,6 +13,12 @@ const s3 = new AWS.S3({ apiVersion: '2006-03-01' });
module.exports.create = (createOptions) => { 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({