From a3dddcf40aee96aa6d323b726b188ca87ad97f7a Mon Sep 17 00:00:00 2001 From: Cristiano Betta Date: Fri, 6 Apr 2018 12:04:46 +0100 Subject: [PATCH] Set default log level to silent --- README.md | 2 +- npm-shrinkwrap.json | 2 +- package.json | 2 +- spec/amadeus/client.test.js | 2 +- src/amadeus/client.js | 2 +- src/amadeus/client/errors.js | 2 -- src/amadeus/client/validator.js | 2 +- 7 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e09a585..d6e3b99 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ var amadeus = new Amadeus({ }); ``` -Additionally, to enable more verbose logging, you can set the appropriate level on your own logger, though the easiest way would be to enable debugging via a parameter on initialization, or using the `AMADEUS_LOG_LEVEL` environment variable. The available options are `warn` (default), `debug`, and `silent`. +Additionally, to enable more verbose logging, you can set the appropriate level on your own logger, though the easiest way would be to enable debugging via a parameter on initialization, or using the `AMADEUS_LOG_LEVEL` environment variable. The available options are `silent` (default), `warn`, and `debug`. ```js var amadeus = new Amadeus({ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 14647d9..599a2c8 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "amadeus", - "version": "1.0.0-beta3", + "version": "1.0.0-beta5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 97c06c1..1d648d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "amadeus", - "version": "1.0.0-beta4", + "version": "1.0.0-beta5", "description": "Node library for the Amadeus travel APIs", "main": "lib/amadeus.js", "scripts": { diff --git a/spec/amadeus/client.test.js b/spec/amadeus/client.test.js index dbabb0f..f56ffcd 100644 --- a/spec/amadeus/client.test.js +++ b/spec/amadeus/client.test.js @@ -39,7 +39,7 @@ describe('Client', () => { expect(client.customAppId).toBe(null); expect(client.customAppVersion).toBe(null); expect(client.http).toBe(https); - expect(client.logLevel).toBe('warn'); + expect(client.logLevel).toBe('silent'); }); it('should allow for setting a custom logger', () => { diff --git a/src/amadeus/client.js b/src/amadeus/client.js index 5d45a37..050fa92 100644 --- a/src/amadeus/client.js +++ b/src/amadeus/client.js @@ -30,7 +30,7 @@ import pkg from '../../package.json'; * the API * @property {Object} logger the `console`-compatible logger used to debug calls * @property {string} logLevel the log level for the client, available options - * are `debug`, `warn`, and `silent` + * are `debug`, `warn`, and `silent`. Defaults to 'silent' * @property {string} host the hostname of the server API calls are made to * @property {number} port the port the server API calls are made to * @property {boolean} ssl wether an SSL request is made to the server diff --git a/src/amadeus/client/errors.js b/src/amadeus/client/errors.js index b46835a..0275795 100644 --- a/src/amadeus/client/errors.js +++ b/src/amadeus/client/errors.js @@ -31,8 +31,6 @@ export class ResponseError { } } - - // Protected export class NetworkError extends ResponseError { diff --git a/src/amadeus/client/validator.js b/src/amadeus/client/validator.js index 31d4ce4..448f276 100644 --- a/src/amadeus/client/validator.js +++ b/src/amadeus/client/validator.js @@ -53,7 +53,7 @@ class Validator { initializeLogger(client, options) { client.logger = this.initOptional('logger', options, console); - client.logLevel = this.initOptional('logLevel', options, 'warn'); + client.logLevel = this.initOptional('logLevel', options, 'silent'); } initializeHost(client, options) {