Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #94 from frdwrd/master
Browse files Browse the repository at this point in the history
Add default logger to index.js
  • Loading branch information
William Blankenship committed Apr 15, 2017
2 parents 31c0139 + 59b3c94 commit b405f3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ function Storage(mongoURI, mongoOptions, storageOptions) {

this._uri = mongoURI;
this._options = mongoOptions;
this._log = storageOptions ? (storageOptions.logger || console) : console;

const defaultLogger = {
info: console.log,
debug: console.log,
error: console.error,
warn: console.warn
};
this._log = storageOptions ?
(storageOptions.logger || defaultLogger) : defaultLogger;

this.connection = this._connect();
this.models = this._createBoundModels();

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "storj-service-storage-models",
"version": "8.15.0",
"version": "8.16.1",
"description": "common storage models for various storj services",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit b405f3e

Please sign in to comment.