diff --git a/package.json b/package.json index a7929a4..ef99871 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@swrlab/node-storage-wrapper", - "version": "0.0.10", + "version": "0.0.11", "description": "Wrapping AWS S3, GCP GCS, file storage", "main": "./src/index.js", "engines": { diff --git a/src/index.js b/src/index.js index 6aa2f51..413aec1 100644 --- a/src/index.js +++ b/src/index.js @@ -27,8 +27,7 @@ function StorageWrapper(config) { // load aws sdk if (config.s3) { - AWS.config.loadFromPath(config.s3); - this.sdk.s3 = new AWS.S3(); + this.sdk.s3 = new AWS.S3(config.s3); } // configure logging @@ -60,7 +59,14 @@ function StorageWrapper(config) { this.save = require('./save'); // log progress - this.sdk.log(this, 'log', ['storage.index', 'loaded config >', JSON.stringify({ config })]); + this.sdk.log(this, 'log', [ + 'storage.index', + 'loaded config', + JSON.stringify({ + gs: config.gs ? config.gs.projectId : null, + s3: config.s3 ? { accessKeyId: config.s3.accessKeyId, region: config.s3.region } : null, + }), + ]); } // export