Skip to content

Commit

Permalink
add silence
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanoff committed Sep 6, 2020
1 parent 9d2dcf6 commit 55ca09e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -7,7 +7,7 @@

# API-I

### v.10.0.1
### v.10.1.1

## Example

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "api-i",
"version": "10.0.1",
"version": "10.1.1",
"description": "Create REST API",
"license": "MIT",
"main": "src/index.js",
Expand Down
9 changes: 9 additions & 0 deletions src/base.js
Expand Up @@ -63,6 +63,15 @@ class Base {
}

initLog() {
if (this.config.silence) {
this.log = {
info: () => {},
warn: () => {},
debug: () => {},
error: () => {},
};
return;
}
this.log = winston.createLogger({
level: this.config.logLevel,
format: winston.format.json(),
Expand Down

0 comments on commit 55ca09e

Please sign in to comment.