@webex/plugin-logger 2.59.3-next.1 → 2.59.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +6 -6
- package/README.md +82 -82
- package/babel.config.js +3 -3
- package/dist/config.js +13 -13
- package/dist/config.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/logger.js +75 -75
- package/dist/logger.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +16 -17
- package/process +1 -1
- package/src/config.js +23 -23
- package/src/index.js +15 -15
- package/src/logger.js +427 -427
- package/test/unit/spec/logger.js +805 -805
package/.eslintrc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const config = {
|
|
2
|
-
root: true,
|
|
3
|
-
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
module.exports = config;
|
|
1
|
+
const config = {
|
|
2
|
+
root: true,
|
|
3
|
+
extends: ['@webex/eslint-config-legacy'],
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
module.exports = config;
|
package/README.md
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
# @webex/plugin-logger
|
|
2
|
-
|
|
3
|
-
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
-
|
|
5
|
-
> Logging plugin for the Cisco Webex JS SDK.
|
|
6
|
-
|
|
7
|
-
- [@webex/plugin-logger](#webexplugin-logger)
|
|
8
|
-
- [Install](#install)
|
|
9
|
-
- [Usage](#usage)
|
|
10
|
-
- [Log Levels](#log-levels)
|
|
11
|
-
- [Level Control](#level-control)
|
|
12
|
-
- [Maintainers](#maintainers)
|
|
13
|
-
- [Contribute](#contribute)
|
|
14
|
-
- [License](#license)
|
|
15
|
-
|
|
16
|
-
## Install
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install --save @webex/plugin-logger
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Usage
|
|
23
|
-
|
|
24
|
-
This is a plugin for the Cisco Webex JS SDK . Please see our [developer portal](https://developer.webex.com/) and the [API docs](https://webex.github.io/webex-js-sdk/api/) for full details.
|
|
25
|
-
|
|
26
|
-
```js
|
|
27
|
-
const Webex = require('webex');
|
|
28
|
-
const webex = Webex.init();
|
|
29
|
-
|
|
30
|
-
webex.logger.info('Hello World'); // => wx-js-sdk Hello World
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Log Levels
|
|
34
|
-
|
|
35
|
-
This logger plugin supports different logging levels to control what gets output to the user's console:
|
|
36
|
-
|
|
37
|
-
- **silent**
|
|
38
|
-
- Nothing prints to the console.
|
|
39
|
-
- **error** [DEFAULT]
|
|
40
|
-
- Error messages thrown by exceptions. This level is meant for the developer and end user to help with troubleshooting.
|
|
41
|
-
- Example: `Unable to connect to websocket on port 4343`
|
|
42
|
-
- **warn**
|
|
43
|
-
- Warning messages meant to help guide developers away from potential errors.
|
|
44
|
-
- Example: `The usage of person email has been deprecated`
|
|
45
|
-
- **log**
|
|
46
|
-
- General output of logging messages.
|
|
47
|
-
- Example: `Websocket connected on port 4343`
|
|
48
|
-
- **info**
|
|
49
|
-
- More detailed logging of SDK information.
|
|
50
|
-
- Example: `Network status changed from DISCONNECTED to ONLINE`
|
|
51
|
-
- **debug**
|
|
52
|
-
- Developer specific information, helpful with debugging issues.
|
|
53
|
-
- Example: `Network packet received, contents: {data}`
|
|
54
|
-
- **trace**
|
|
55
|
-
- Prints the stack trace of the current call path.
|
|
56
|
-
|
|
57
|
-
### Level Control
|
|
58
|
-
|
|
59
|
-
The developer can control what level gets printed by setting the environment variable: `WEBEX_LOG_LEVEL`.
|
|
60
|
-
|
|
61
|
-
These variables can be set on the command line or in the `.env` file:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
WEBEX_LOG_LEVEL="debug" npm start
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
```env
|
|
68
|
-
# .env file
|
|
69
|
-
WEBEX_LOG_LEVEL=debug
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Maintainers
|
|
73
|
-
|
|
74
|
-
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
75
|
-
|
|
76
|
-
## Contribute
|
|
77
|
-
|
|
78
|
-
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
79
|
-
|
|
80
|
-
## License
|
|
81
|
-
|
|
82
|
-
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
|
1
|
+
# @webex/plugin-logger
|
|
2
|
+
|
|
3
|
+
[](https://github.com/RichardLitt/standard-readme)
|
|
4
|
+
|
|
5
|
+
> Logging plugin for the Cisco Webex JS SDK.
|
|
6
|
+
|
|
7
|
+
- [@webex/plugin-logger](#webexplugin-logger)
|
|
8
|
+
- [Install](#install)
|
|
9
|
+
- [Usage](#usage)
|
|
10
|
+
- [Log Levels](#log-levels)
|
|
11
|
+
- [Level Control](#level-control)
|
|
12
|
+
- [Maintainers](#maintainers)
|
|
13
|
+
- [Contribute](#contribute)
|
|
14
|
+
- [License](#license)
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install --save @webex/plugin-logger
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
This is a plugin for the Cisco Webex JS SDK . Please see our [developer portal](https://developer.webex.com/) and the [API docs](https://webex.github.io/webex-js-sdk/api/) for full details.
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
const Webex = require('webex');
|
|
28
|
+
const webex = Webex.init();
|
|
29
|
+
|
|
30
|
+
webex.logger.info('Hello World'); // => wx-js-sdk Hello World
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Log Levels
|
|
34
|
+
|
|
35
|
+
This logger plugin supports different logging levels to control what gets output to the user's console:
|
|
36
|
+
|
|
37
|
+
- **silent**
|
|
38
|
+
- Nothing prints to the console.
|
|
39
|
+
- **error** [DEFAULT]
|
|
40
|
+
- Error messages thrown by exceptions. This level is meant for the developer and end user to help with troubleshooting.
|
|
41
|
+
- Example: `Unable to connect to websocket on port 4343`
|
|
42
|
+
- **warn**
|
|
43
|
+
- Warning messages meant to help guide developers away from potential errors.
|
|
44
|
+
- Example: `The usage of person email has been deprecated`
|
|
45
|
+
- **log**
|
|
46
|
+
- General output of logging messages.
|
|
47
|
+
- Example: `Websocket connected on port 4343`
|
|
48
|
+
- **info**
|
|
49
|
+
- More detailed logging of SDK information.
|
|
50
|
+
- Example: `Network status changed from DISCONNECTED to ONLINE`
|
|
51
|
+
- **debug**
|
|
52
|
+
- Developer specific information, helpful with debugging issues.
|
|
53
|
+
- Example: `Network packet received, contents: {data}`
|
|
54
|
+
- **trace**
|
|
55
|
+
- Prints the stack trace of the current call path.
|
|
56
|
+
|
|
57
|
+
### Level Control
|
|
58
|
+
|
|
59
|
+
The developer can control what level gets printed by setting the environment variable: `WEBEX_LOG_LEVEL`.
|
|
60
|
+
|
|
61
|
+
These variables can be set on the command line or in the `.env` file:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
WEBEX_LOG_LEVEL="debug" npm start
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```env
|
|
68
|
+
# .env file
|
|
69
|
+
WEBEX_LOG_LEVEL=debug
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Maintainers
|
|
73
|
+
|
|
74
|
+
This package is maintained by [Cisco Webex for Developers](https://developer.webex.com/).
|
|
75
|
+
|
|
76
|
+
## Contribute
|
|
77
|
+
|
|
78
|
+
Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/webex-js-sdk/blob/master/CONTRIBUTING.md) for more details.
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
© 2016-2020 Cisco and/or its affiliates. All Rights Reserved.
|
package/babel.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
-
|
|
3
|
-
module.exports = babelConfigLegacy;
|
|
1
|
+
const babelConfigLegacy = require('@webex/babel-config-legacy');
|
|
2
|
+
|
|
3
|
+
module.exports = babelConfigLegacy;
|
package/dist/config.js
CHANGED
|
@@ -5,20 +5,20 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
/*!
|
|
9
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
10
10
|
*/
|
|
11
|
-
/**
|
|
12
|
-
* @typedef {Object} LoggerConfig
|
|
13
|
-
* @property {string} [level=process.env.WEBEX_LOG_LEVEL] - Maximum log level that
|
|
14
|
-
* should be printed to the console. One of
|
|
15
|
-
* silent|error|warn|log|info|debug|trace
|
|
16
|
-
* @property {number} [historyLength=1000] - Maximum number of entries to store in the log buffer.
|
|
17
|
-
* @example
|
|
18
|
-
* {
|
|
19
|
-
* level: process.env.WEBEX_LOG_LEVEL,
|
|
20
|
-
* historyLength: 1000
|
|
21
|
-
* }
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {Object} LoggerConfig
|
|
13
|
+
* @property {string} [level=process.env.WEBEX_LOG_LEVEL] - Maximum log level that
|
|
14
|
+
* should be printed to the console. One of
|
|
15
|
+
* silent|error|warn|log|info|debug|trace
|
|
16
|
+
* @property {number} [historyLength=1000] - Maximum number of entries to store in the log buffer.
|
|
17
|
+
* @example
|
|
18
|
+
* {
|
|
19
|
+
* level: process.env.WEBEX_LOG_LEVEL,
|
|
20
|
+
* historyLength: 1000
|
|
21
|
+
* }
|
|
22
22
|
*/
|
|
23
23
|
var _default = {
|
|
24
24
|
logger: {
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_default","logger","level","process","env","WEBEX_LOG_LEVEL","historyLength","exports","default"],"sources":["config.js"],"sourcesContent":["/*!\
|
|
1
|
+
{"version":3,"names":["_default","logger","level","process","env","WEBEX_LOG_LEVEL","historyLength","exports","default"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * @typedef {Object} LoggerConfig\n * @property {string} [level=process.env.WEBEX_LOG_LEVEL] - Maximum log level that\n * should be printed to the console. One of\n * silent|error|warn|log|info|debug|trace\n * @property {number} [historyLength=1000] - Maximum number of entries to store in the log buffer.\n * @example\n * {\n * level: process.env.WEBEX_LOG_LEVEL,\n * historyLength: 1000\n * }\n */\n\nexport default {\n logger: {\n level: process.env.WEBEX_LOG_LEVEL,\n historyLength: 1000,\n },\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXA,IAAAA,QAAA,GAae;EACbC,MAAM,EAAE;IACNC,KAAK,EAAEC,OAAO,CAACC,GAAG,CAACC,eAAe;IAClCC,aAAa,EAAE;EACjB;AACF,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAR,QAAA"}
|
package/dist/index.js
CHANGED
|
@@ -25,8 +25,8 @@ var _logger = _interopRequireWildcard(require("./logger"));
|
|
|
25
25
|
var _config = _interopRequireDefault(require("./config"));
|
|
26
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
|
-
/*!
|
|
29
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
28
|
+
/*!
|
|
29
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
(0, _webexCore.registerPlugin)('logger', _logger.default, {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_webexCore","require","_logger","_interopRequireWildcard","_config","_interopRequireDefault","_getRequireWildcardCache","nodeInterop","_WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","_Object$defineProperty","_Object$getOwnPropertyDescriptor","key","Object","prototype","hasOwnProperty","call","desc","set","registerPlugin","Logger","config","replace"],"sources":["index.js"],"sourcesContent":["/*!\
|
|
1
|
+
{"version":3,"names":["_webexCore","require","_logger","_interopRequireWildcard","_config","_interopRequireDefault","_getRequireWildcardCache","nodeInterop","_WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","_Object$defineProperty","_Object$getOwnPropertyDescriptor","key","Object","prototype","hasOwnProperty","call","desc","set","registerPlugin","Logger","config","replace"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {registerPlugin} from '@webex/webex-core';\n\nimport Logger from './logger';\nimport config from './config';\n\nregisterPlugin('logger', Logger, {\n config,\n replace: true,\n});\n\nexport {default, levels} from './logger';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAA8B,SAAAK,yBAAAC,WAAA,eAAAC,QAAA,kCAAAC,iBAAA,OAAAD,QAAA,QAAAE,gBAAA,OAAAF,QAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,4BAAAG,OAAA,EAAAH,GAAA,UAAAI,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAL,GAAA,YAAAI,KAAA,CAAAE,GAAA,CAAAN,GAAA,SAAAO,MAAA,WAAAC,qBAAA,GAAAC,sBAAA,IAAAC,gCAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAC,MAAA,CAAAC,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAf,GAAA,EAAAW,GAAA,SAAAK,IAAA,GAAAR,qBAAA,GAAAE,gCAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAK,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,sBAAA,CAAAF,MAAA,EAAAI,GAAA,EAAAK,IAAA,YAAAT,MAAA,CAAAI,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAJ,MAAA,CAAAJ,OAAA,GAAAH,GAAA,MAAAI,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAjB,GAAA,EAAAO,MAAA,YAAAA,MAAA;AAP9B;AACA;AACA;;AAOA,IAAAW,yBAAc,EAAC,QAAQ,EAAEC,eAAM,EAAE;EAC/BC,MAAM,EAANA,eAAM;EACNC,OAAO,EAAE;AACX,CAAC,CAAC"}
|
package/dist/logger.js
CHANGED
|
@@ -18,8 +18,8 @@ var _has2 = _interopRequireDefault(require("lodash/has"));
|
|
|
18
18
|
var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
19
19
|
var _common = require("@webex/common");
|
|
20
20
|
var _webexCore = require("@webex/webex-core");
|
|
21
|
-
/*!
|
|
22
|
-
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
21
|
+
/*!
|
|
22
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
var precedence = {
|
|
@@ -51,12 +51,12 @@ var LOG_TYPES = {
|
|
|
51
51
|
var SDK_LOG_TYPE_NAME = 'wx-js-sdk';
|
|
52
52
|
var authTokenKeyPattern = /[Aa]uthorization/;
|
|
53
53
|
|
|
54
|
-
/**
|
|
55
|
-
* Recursively strips "authorization" fields from the specified object
|
|
56
|
-
* @param {Object} object
|
|
57
|
-
* @param {Array<mixed>} [visited]
|
|
58
|
-
* @private
|
|
59
|
-
* @returns {Object}
|
|
54
|
+
/**
|
|
55
|
+
* Recursively strips "authorization" fields from the specified object
|
|
56
|
+
* @param {Object} object
|
|
57
|
+
* @param {Array<mixed>} [visited]
|
|
58
|
+
* @private
|
|
59
|
+
* @returns {Object}
|
|
60
60
|
*/
|
|
61
61
|
function walkAndFilter(object) {
|
|
62
62
|
var visited = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -91,8 +91,8 @@ function walkAndFilter(object) {
|
|
|
91
91
|
return object;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
/**
|
|
95
|
-
* @class
|
|
94
|
+
/**
|
|
95
|
+
* @class
|
|
96
96
|
*/
|
|
97
97
|
var Logger = _webexCore.WebexPlugin.extend({
|
|
98
98
|
namespace: 'Logger',
|
|
@@ -138,12 +138,12 @@ var Logger = _webexCore.WebexPlugin.extend({
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
|
-
/**
|
|
142
|
-
* Ensures auth headers don't get printed in logs
|
|
143
|
-
* @param {Array<mixed>} args
|
|
144
|
-
* @private
|
|
145
|
-
* @memberof Logger
|
|
146
|
-
* @returns {Array<mixed>}
|
|
141
|
+
/**
|
|
142
|
+
* Ensures auth headers don't get printed in logs
|
|
143
|
+
* @param {Array<mixed>} args
|
|
144
|
+
* @private
|
|
145
|
+
* @memberof Logger
|
|
146
|
+
* @returns {Array<mixed>}
|
|
147
147
|
*/
|
|
148
148
|
filter: function filter() {
|
|
149
149
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -168,42 +168,42 @@ var Logger = _webexCore.WebexPlugin.extend({
|
|
|
168
168
|
return walkAndFilter(arg);
|
|
169
169
|
});
|
|
170
170
|
},
|
|
171
|
-
/**
|
|
172
|
-
* Determines if the current level allows logs at the specified level to be
|
|
173
|
-
* printed
|
|
174
|
-
* @param {string} level
|
|
175
|
-
* @param {string} type type of log, SDK or client
|
|
176
|
-
* @private
|
|
177
|
-
* @memberof Logger
|
|
178
|
-
* @returns {boolean}
|
|
171
|
+
/**
|
|
172
|
+
* Determines if the current level allows logs at the specified level to be
|
|
173
|
+
* printed
|
|
174
|
+
* @param {string} level
|
|
175
|
+
* @param {string} type type of log, SDK or client
|
|
176
|
+
* @private
|
|
177
|
+
* @memberof Logger
|
|
178
|
+
* @returns {boolean}
|
|
179
179
|
*/
|
|
180
180
|
shouldPrint: function shouldPrint(level) {
|
|
181
181
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : LOG_TYPES.SDK;
|
|
182
182
|
return precedence[level] <= precedence[type === LOG_TYPES.SDK ? this.getCurrentLevel() : this.getCurrentClientLevel()];
|
|
183
183
|
},
|
|
184
|
-
/**
|
|
185
|
-
* Determines if the current level allows logs at the specified level to be
|
|
186
|
-
* put into the log buffer. We're configuring it omit trace and debug logs
|
|
187
|
-
* because there are *a lot* of debug logs that really don't provide value at
|
|
188
|
-
* runtime (they're helpful for debugging locally, but really just pollute the
|
|
189
|
-
* uploaded logs and push useful info out).
|
|
190
|
-
* @param {string} level
|
|
191
|
-
* @param {string} type type of log, SDK or client
|
|
192
|
-
* @private
|
|
193
|
-
* @memberof Logger
|
|
194
|
-
* @returns {boolean}
|
|
184
|
+
/**
|
|
185
|
+
* Determines if the current level allows logs at the specified level to be
|
|
186
|
+
* put into the log buffer. We're configuring it omit trace and debug logs
|
|
187
|
+
* because there are *a lot* of debug logs that really don't provide value at
|
|
188
|
+
* runtime (they're helpful for debugging locally, but really just pollute the
|
|
189
|
+
* uploaded logs and push useful info out).
|
|
190
|
+
* @param {string} level
|
|
191
|
+
* @param {string} type type of log, SDK or client
|
|
192
|
+
* @private
|
|
193
|
+
* @memberof Logger
|
|
194
|
+
* @returns {boolean}
|
|
195
195
|
*/
|
|
196
196
|
shouldBuffer: function shouldBuffer(level) {
|
|
197
197
|
return precedence[level] <= (this.config.bufferLogLevel ? precedence[this.config.bufferLogLevel] : precedence.info);
|
|
198
198
|
},
|
|
199
|
-
/**
|
|
200
|
-
* Indicates the current SDK log level based on env vars, feature toggles, and
|
|
201
|
-
* user type.
|
|
202
|
-
* @instance
|
|
203
|
-
* @memberof Logger
|
|
204
|
-
* @private
|
|
205
|
-
* @memberof Logger
|
|
206
|
-
* @returns {string}
|
|
199
|
+
/**
|
|
200
|
+
* Indicates the current SDK log level based on env vars, feature toggles, and
|
|
201
|
+
* user type.
|
|
202
|
+
* @instance
|
|
203
|
+
* @memberof Logger
|
|
204
|
+
* @private
|
|
205
|
+
* @memberof Logger
|
|
206
|
+
* @returns {string}
|
|
207
207
|
*/
|
|
208
208
|
// eslint-disable-next-line complexity
|
|
209
209
|
getCurrentLevel: function getCurrentLevel() {
|
|
@@ -229,13 +229,13 @@ var Logger = _webexCore.WebexPlugin.extend({
|
|
|
229
229
|
}
|
|
230
230
|
return 'error';
|
|
231
231
|
},
|
|
232
|
-
/**
|
|
233
|
-
* Indicates the current client log level based on config, defaults to SDK level
|
|
234
|
-
* @instance
|
|
235
|
-
* @memberof Logger
|
|
236
|
-
* @private
|
|
237
|
-
* @memberof Logger
|
|
238
|
-
* @returns {string}
|
|
232
|
+
/**
|
|
233
|
+
* Indicates the current client log level based on config, defaults to SDK level
|
|
234
|
+
* @instance
|
|
235
|
+
* @memberof Logger
|
|
236
|
+
* @private
|
|
237
|
+
* @memberof Logger
|
|
238
|
+
* @returns {string}
|
|
239
239
|
*/
|
|
240
240
|
getCurrentClientLevel: function getCurrentClientLevel() {
|
|
241
241
|
// If a client log level has been explicitly set via config, alway use it.
|
|
@@ -246,16 +246,16 @@ var Logger = _webexCore.WebexPlugin.extend({
|
|
|
246
246
|
// otherwise default to SDK level
|
|
247
247
|
return this.getCurrentLevel();
|
|
248
248
|
},
|
|
249
|
-
/**
|
|
250
|
-
* Format logs (for upload)
|
|
251
|
-
*
|
|
252
|
-
* If separate client, SDK buffers is configured, merge the buffers, if configured
|
|
253
|
-
*
|
|
254
|
-
* @instance
|
|
255
|
-
* @memberof Logger
|
|
256
|
-
* @public
|
|
257
|
-
* @memberof Logger
|
|
258
|
-
* @returns {string} formatted buffer
|
|
249
|
+
/**
|
|
250
|
+
* Format logs (for upload)
|
|
251
|
+
*
|
|
252
|
+
* If separate client, SDK buffers is configured, merge the buffers, if configured
|
|
253
|
+
*
|
|
254
|
+
* @instance
|
|
255
|
+
* @memberof Logger
|
|
256
|
+
* @public
|
|
257
|
+
* @memberof Logger
|
|
258
|
+
* @returns {string} formatted buffer
|
|
259
259
|
*/
|
|
260
260
|
formatLogs: function formatLogs() {
|
|
261
261
|
function getDate(log) {
|
|
@@ -288,23 +288,23 @@ var Logger = _webexCore.WebexPlugin.extend({
|
|
|
288
288
|
}
|
|
289
289
|
return buffer.join('\n');
|
|
290
290
|
},
|
|
291
|
-
version: "2.59.
|
|
291
|
+
version: "2.59.4"
|
|
292
292
|
});
|
|
293
293
|
|
|
294
|
-
/**
|
|
295
|
-
* Creates a logger method
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
* @param {string} level level to create (info, error, warn, etc.)
|
|
299
|
-
* @param {string} impl the level to use when writing to console
|
|
300
|
-
* @param {string} type type of log, SDK or client
|
|
301
|
-
* @param {bool} neverPrint function never prints to console
|
|
302
|
-
* @param {bool} alwaysBuffer function always logs to log buffer
|
|
303
|
-
* @instance
|
|
304
|
-
* @memberof Logger
|
|
305
|
-
* @private
|
|
306
|
-
* @memberof Logger
|
|
307
|
-
* @returns {function} logger method with specified params
|
|
294
|
+
/**
|
|
295
|
+
* Creates a logger method
|
|
296
|
+
*
|
|
297
|
+
*
|
|
298
|
+
* @param {string} level level to create (info, error, warn, etc.)
|
|
299
|
+
* @param {string} impl the level to use when writing to console
|
|
300
|
+
* @param {string} type type of log, SDK or client
|
|
301
|
+
* @param {bool} neverPrint function never prints to console
|
|
302
|
+
* @param {bool} alwaysBuffer function always logs to log buffer
|
|
303
|
+
* @instance
|
|
304
|
+
* @memberof Logger
|
|
305
|
+
* @private
|
|
306
|
+
* @memberof Logger
|
|
307
|
+
* @returns {function} logger method with specified params
|
|
308
308
|
*/
|
|
309
309
|
function makeLoggerMethod(level, impl, type) {
|
|
310
310
|
var neverPrint = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
package/dist/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_common","require","_webexCore","precedence","silent","group","groupEnd","error","warn","log","info","debug","trace","levels","_keys","default","filter","level","exports","fallbacks","LOG_TYPES","SDK","CLIENT","SDK_LOG_TYPE_NAME","authTokenKeyPattern","walkAndFilter","object","visited","arguments","length","undefined","includes","push","_isArray2","map","o","_isObject2","_isString2","patterns","containsEmails","test","replace","_i","_Object$entries","_entries","_Object$entries$_i","_slicedToArray2","key","value","_deleteProperty","Logger","WebexPlugin","extend","namespace","derived","cache","fn","getCurrentLevel","client_level","getCurrentClientLevel","session","buffer","type","_default","groupLevel","sdkBuffer","clientBuffer","_len","args","Array","_key","arg","Error","process","env","NODE_ENV","inBrowser","ret","toString","stack","_cloneDeep2","shouldPrint","shouldBuffer","config","bufferLogLevel","WEBEX_LOG_LEVEL","webex","internal","device","features","developer","get","clientLevel","formatLogs","getDate","clientIndex","sdkIndex","separateLogBuffers","Date","join","version","makeLoggerMethod","impl","neverPrint","alwaysBuffer","wrappedConsoleMethod","logType","clientName","historyLength","clientHistoryLength","filtered","concat","_toConsumableArray2","apply","stringified","item","WebexHttpError","_console","toPrint","_has2","unshift","url","slice","console","logDate","toISOString","repeat","shift","reason","forEach","impls","pop","prototype","client_logToBuffer","logToBuffer","_default2"],"sources":["logger.js"],"sourcesContent":["/*!\r\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\r\n */\r\n\r\nimport {inBrowser, patterns} from '@webex/common';\r\nimport {WebexHttpError, WebexPlugin} from '@webex/webex-core';\r\nimport {cloneDeep, has, isArray, isObject, isString} from 'lodash';\r\n\r\nconst precedence = {\r\n silent: 0,\r\n group: 1,\r\n groupEnd: 2,\r\n error: 3,\r\n warn: 4,\r\n log: 5,\r\n info: 6,\r\n debug: 7,\r\n trace: 8,\r\n};\r\n\r\nexport const levels = Object.keys(precedence).filter((level) => level !== 'silent');\r\n\r\nconst fallbacks = {\r\n error: ['log'],\r\n warn: ['error', 'log'],\r\n info: ['log'],\r\n debug: ['info', 'log'],\r\n trace: ['debug', 'info', 'log'],\r\n};\r\n\r\nconst LOG_TYPES = {\r\n SDK: 'sdk',\r\n CLIENT: 'client',\r\n};\r\n\r\nconst SDK_LOG_TYPE_NAME = 'wx-js-sdk';\r\n\r\nconst authTokenKeyPattern = /[Aa]uthorization/;\r\n\r\n/**\r\n * Recursively strips \"authorization\" fields from the specified object\r\n * @param {Object} object\r\n * @param {Array<mixed>} [visited]\r\n * @private\r\n * @returns {Object}\r\n */\r\nfunction walkAndFilter(object, visited = []) {\r\n if (visited.includes(object)) {\r\n // Prevent circular references\r\n return object;\r\n }\r\n\r\n visited.push(object);\r\n\r\n if (isArray(object)) {\r\n return object.map((o) => walkAndFilter(o, visited));\r\n }\r\n if (!isObject(object)) {\r\n if (isString(object)) {\r\n if (patterns.containsEmails.test(object)) {\r\n return object.replace(patterns.containsEmails, '[REDACTED]');\r\n }\r\n }\r\n\r\n return object;\r\n }\r\n\r\n for (const [key, value] of Object.entries(object)) {\r\n if (authTokenKeyPattern.test(key)) {\r\n Reflect.deleteProperty(object, key);\r\n } else {\r\n object[key] = walkAndFilter(value, visited);\r\n }\r\n }\r\n\r\n return object;\r\n}\r\n\r\n/**\r\n * @class\r\n */\r\nconst Logger = WebexPlugin.extend({\r\n namespace: 'Logger',\r\n\r\n derived: {\r\n level: {\r\n cache: false,\r\n fn() {\r\n return this.getCurrentLevel();\r\n },\r\n },\r\n client_level: {\r\n cache: false,\r\n fn() {\r\n return this.getCurrentClientLevel();\r\n },\r\n },\r\n },\r\n session: {\r\n // for when configured to use single buffer\r\n buffer: {\r\n type: 'array',\r\n default() {\r\n return [];\r\n },\r\n },\r\n groupLevel: {\r\n type: 'number',\r\n default() {\r\n return 0;\r\n },\r\n },\r\n // for when configured to use separate buffers\r\n sdkBuffer: {\r\n type: 'array',\r\n default() {\r\n return [];\r\n },\r\n },\r\n clientBuffer: {\r\n type: 'array',\r\n default() {\r\n return [];\r\n },\r\n },\r\n },\r\n\r\n /**\r\n * Ensures auth headers don't get printed in logs\r\n * @param {Array<mixed>} args\r\n * @private\r\n * @memberof Logger\r\n * @returns {Array<mixed>}\r\n */\r\n filter(...args) {\r\n return args.map((arg) => {\r\n // WebexHttpError already ensures auth tokens don't get printed, so, no\r\n // need to alter it here.\r\n if (arg instanceof Error) {\r\n // karma logs won't print subclassed errors correctly, so we need\r\n // explicitly call their tostring methods.\r\n if (process.env.NODE_ENV === 'test' && inBrowser) {\r\n let ret = arg.toString();\r\n\r\n ret += 'BEGIN STACK';\r\n ret += arg.stack;\r\n ret += 'END STACK';\r\n\r\n return ret;\r\n }\r\n\r\n return arg;\r\n }\r\n\r\n arg = cloneDeep(arg);\r\n\r\n return walkAndFilter(arg);\r\n });\r\n },\r\n\r\n /**\r\n * Determines if the current level allows logs at the specified level to be\r\n * printed\r\n * @param {string} level\r\n * @param {string} type type of log, SDK or client\r\n * @private\r\n * @memberof Logger\r\n * @returns {boolean}\r\n */\r\n shouldPrint(level, type = LOG_TYPES.SDK) {\r\n return (\r\n precedence[level] <=\r\n precedence[type === LOG_TYPES.SDK ? this.getCurrentLevel() : this.getCurrentClientLevel()]\r\n );\r\n },\r\n\r\n /**\r\n * Determines if the current level allows logs at the specified level to be\r\n * put into the log buffer. We're configuring it omit trace and debug logs\r\n * because there are *a lot* of debug logs that really don't provide value at\r\n * runtime (they're helpful for debugging locally, but really just pollute the\r\n * uploaded logs and push useful info out).\r\n * @param {string} level\r\n * @param {string} type type of log, SDK or client\r\n * @private\r\n * @memberof Logger\r\n * @returns {boolean}\r\n */\r\n shouldBuffer(level) {\r\n return (\r\n precedence[level] <=\r\n (this.config.bufferLogLevel ? precedence[this.config.bufferLogLevel] : precedence.info)\r\n );\r\n },\r\n\r\n /**\r\n * Indicates the current SDK log level based on env vars, feature toggles, and\r\n * user type.\r\n * @instance\r\n * @memberof Logger\r\n * @private\r\n * @memberof Logger\r\n * @returns {string}\r\n */\r\n // eslint-disable-next-line complexity\r\n getCurrentLevel() {\r\n // If a level has been explicitly set via config, alway use it.\r\n if (this.config.level) {\r\n return this.config.level;\r\n }\r\n\r\n if (levels.includes(process.env.WEBEX_LOG_LEVEL)) {\r\n return process.env.WEBEX_LOG_LEVEL;\r\n }\r\n\r\n // Always use debug-level logging in test mode;\r\n if (process.env.NODE_ENV === 'test') {\r\n return 'trace';\r\n }\r\n\r\n // Use server-side-feature toggles to configure log levels\r\n const level =\r\n this.webex.internal.device && this.webex.internal.device.features.developer.get('log-level');\r\n\r\n if (level) {\r\n if (levels.includes(level)) {\r\n return level;\r\n }\r\n }\r\n\r\n return 'error';\r\n },\r\n\r\n /**\r\n * Indicates the current client log level based on config, defaults to SDK level\r\n * @instance\r\n * @memberof Logger\r\n * @private\r\n * @memberof Logger\r\n * @returns {string}\r\n */\r\n getCurrentClientLevel() {\r\n // If a client log level has been explicitly set via config, alway use it.\r\n if (this.config.clientLevel) {\r\n return this.config.clientLevel;\r\n }\r\n\r\n // otherwise default to SDK level\r\n return this.getCurrentLevel();\r\n },\r\n\r\n /**\r\n * Format logs (for upload)\r\n *\r\n * If separate client, SDK buffers is configured, merge the buffers, if configured\r\n *\r\n * @instance\r\n * @memberof Logger\r\n * @public\r\n * @memberof Logger\r\n * @returns {string} formatted buffer\r\n */\r\n formatLogs() {\r\n function getDate(log) {\r\n return log[1];\r\n }\r\n let buffer = [];\r\n let clientIndex = 0;\r\n let sdkIndex = 0;\r\n\r\n if (this.config.separateLogBuffers) {\r\n // merge the client and sdk buffers\r\n // while we have entries in either buffer\r\n while (clientIndex < this.clientBuffer.length || sdkIndex < this.sdkBuffer.length) {\r\n // if we have remaining entries in the SDK buffer\r\n if (\r\n sdkIndex < this.sdkBuffer.length &&\r\n // and we haven't exhausted all the client buffer entries, or SDK date is before client date\r\n (clientIndex >= this.clientBuffer.length ||\r\n new Date(getDate(this.sdkBuffer[sdkIndex])) <=\r\n new Date(getDate(this.clientBuffer[clientIndex])))\r\n ) {\r\n // then add to the SDK buffer\r\n buffer.push(this.sdkBuffer[sdkIndex]);\r\n sdkIndex += 1;\r\n }\r\n // otherwise if we haven't exhausted all the client buffer entries, add client entry, whether it was because\r\n // it was the only remaining entries or date was later (the above if)\r\n else if (clientIndex < this.clientBuffer.length) {\r\n buffer.push(this.clientBuffer[clientIndex]);\r\n clientIndex += 1;\r\n }\r\n }\r\n } else {\r\n buffer = this.buffer;\r\n }\r\n\r\n return buffer.join('\\n');\r\n },\r\n});\r\n\r\n/**\r\n * Creates a logger method\r\n *\r\n *\r\n * @param {string} level level to create (info, error, warn, etc.)\r\n * @param {string} impl the level to use when writing to console\r\n * @param {string} type type of log, SDK or client\r\n * @param {bool} neverPrint function never prints to console\r\n * @param {bool} alwaysBuffer function always logs to log buffer\r\n * @instance\r\n * @memberof Logger\r\n * @private\r\n * @memberof Logger\r\n * @returns {function} logger method with specified params\r\n */\r\nfunction makeLoggerMethod(level, impl, type, neverPrint = false, alwaysBuffer = false) {\r\n // Much of the complexity in the following function is due to a test-mode-only\r\n // helper\r\n return function wrappedConsoleMethod(...args) {\r\n // it would be easier to just pass in the name and buffer here, but the config isn't completely initialized\r\n // in Ampersand, even if the initialize method is used to set this up. so we keep the type to achieve\r\n // a sort of late binding to allow retrieving a name from config.\r\n const logType = type;\r\n const clientName =\r\n logType === LOG_TYPES.SDK ? SDK_LOG_TYPE_NAME : this.config.clientName || logType;\r\n\r\n let buffer;\r\n let historyLength;\r\n\r\n if (this.config.separateLogBuffers) {\r\n historyLength = this.config.clientHistoryLength\r\n ? this.config.clientHistoryLength\r\n : this.config.historyLength;\r\n buffer = logType === LOG_TYPES.SDK ? this.sdkBuffer : this.clientBuffer;\r\n } else {\r\n buffer = this.buffer;\r\n historyLength = this.config.historyLength;\r\n }\r\n\r\n try {\r\n const shouldPrint = !neverPrint && this.shouldPrint(level, logType);\r\n const shouldBuffer = alwaysBuffer || this.shouldBuffer(level);\r\n\r\n if (!shouldBuffer && !shouldPrint) {\r\n return;\r\n }\r\n\r\n const filtered = [clientName, ...this.filter(...args)];\r\n const stringified = filtered.map((item) => {\r\n if (item instanceof WebexHttpError) {\r\n return item.toString();\r\n }\r\n\r\n return item;\r\n });\r\n\r\n if (shouldPrint) {\r\n // when logging an object in browsers, we tend to get a dynamic\r\n // reference, thus going back to look at the logged value doesn't\r\n // necessarily show the state at log time, thus we print the stringified\r\n // value.\r\n const toPrint = inBrowser ? stringified : filtered;\r\n\r\n /* istanbul ignore if */\r\n if (process.env.NODE_ENV === 'test' && has(this, 'webex.internal.device.url')) {\r\n toPrint.unshift(this.webex.internal.device.url.slice(-3));\r\n }\r\n // eslint-disable-next-line no-console\r\n console[impl](...toPrint);\r\n }\r\n\r\n if (shouldBuffer) {\r\n const logDate = new Date();\r\n\r\n stringified.unshift(logDate.toISOString());\r\n stringified.unshift('| '.repeat(this.groupLevel));\r\n buffer.push(stringified);\r\n if (buffer.length > historyLength) {\r\n buffer.shift();\r\n }\r\n if (level === 'group') this.groupLevel += 1;\r\n if (level === 'groupEnd' && this.groupLevel > 0) this.groupLevel -= 1;\r\n }\r\n } catch (reason) {\r\n if (!neverPrint) {\r\n /* istanbul ignore next */\r\n // eslint-disable-next-line no-console\r\n console.warn(`failed to execute Logger#${level}`, reason);\r\n }\r\n }\r\n };\r\n}\r\n\r\nlevels.forEach((level) => {\r\n let impls = fallbacks[level];\r\n let impl = level;\r\n\r\n if (impls) {\r\n impls = impls.slice();\r\n // eslint-disable-next-line no-console\r\n while (!console[impl]) {\r\n impl = impls.pop();\r\n }\r\n }\r\n\r\n // eslint-disable-next-line complexity\r\n Logger.prototype[`client_${level}`] = makeLoggerMethod(level, impl, LOG_TYPES.CLIENT);\r\n Logger.prototype[level] = makeLoggerMethod(level, impl, LOG_TYPES.SDK);\r\n});\r\n\r\nLogger.prototype.client_logToBuffer = makeLoggerMethod(\r\n levels.info,\r\n levels.info,\r\n LOG_TYPES.CLIENT,\r\n true,\r\n true\r\n);\r\nLogger.prototype.logToBuffer = makeLoggerMethod(\r\n levels.info,\r\n levels.info,\r\n LOG_TYPES.SDK,\r\n true,\r\n true\r\n);\r\n\r\nexport default Logger;\r\n"],"mappings":";;;;;;;;;;;;;;;;;;AAIA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AALA;AACA;AACA;;AAMA,IAAME,UAAU,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G4B,KAAK,CAACC,GAAG,EAAE;IACpB;EACF;;EAEA;EACAjF,MAAM,CAACkF,SAAS,WAAArB,MAAA,CAAW9F,KAAK,EAAG,GAAGoF,gBAAgB,CAACpF,KAAK,EAAEqF,IAAI,EAAElF,SAAS,CAACE,MAAM,CAAC;EACrF4B,MAAM,CAACkF,SAAS,CAACnH,KAAK,CAAC,GAAGoF,gBAAgB,CAACpF,KAAK,EAAEqF,IAAI,EAAElF,SAAS,CAACC,GAAG,CAAC;AACxE,CAAC,CAAC;AAEF6B,MAAM,CAACkF,SAAS,CAACC,kBAAkB,GAAGhC,gBAAgB,CACpDxF,MAAM,CAACH,IAAI,EACXG,MAAM,CAACH,IAAI,EACXU,SAAS,CAACE,MAAM,EAChB,IAAI,EACJ,IAAI,CACL;AACD4B,MAAM,CAACkF,SAAS,CAACE,WAAW,GAAGjC,gBAAgB,CAC7CxF,MAAM,CAACH,IAAI,EACXG,MAAM,CAACH,IAAI,EACXU,SAAS,CAACC,GAAG,EACb,IAAI,EACJ,IAAI,CACL;AAAC,IAAAkH,SAAA,GAEarF,MAAM;AAAAhC,OAAA,CAAAH,OAAA,GAAAwH,SAAA"}
|
|
1
|
+
{"version":3,"names":["_common","require","_webexCore","precedence","silent","group","groupEnd","error","warn","log","info","debug","trace","levels","_keys","default","filter","level","exports","fallbacks","LOG_TYPES","SDK","CLIENT","SDK_LOG_TYPE_NAME","authTokenKeyPattern","walkAndFilter","object","visited","arguments","length","undefined","includes","push","_isArray2","map","o","_isObject2","_isString2","patterns","containsEmails","test","replace","_i","_Object$entries","_entries","_Object$entries$_i","_slicedToArray2","key","value","_deleteProperty","Logger","WebexPlugin","extend","namespace","derived","cache","fn","getCurrentLevel","client_level","getCurrentClientLevel","session","buffer","type","_default","groupLevel","sdkBuffer","clientBuffer","_len","args","Array","_key","arg","Error","process","env","NODE_ENV","inBrowser","ret","toString","stack","_cloneDeep2","shouldPrint","shouldBuffer","config","bufferLogLevel","WEBEX_LOG_LEVEL","webex","internal","device","features","developer","get","clientLevel","formatLogs","getDate","clientIndex","sdkIndex","separateLogBuffers","Date","join","version","makeLoggerMethod","impl","neverPrint","alwaysBuffer","wrappedConsoleMethod","logType","clientName","historyLength","clientHistoryLength","filtered","concat","_toConsumableArray2","apply","stringified","item","WebexHttpError","_console","toPrint","_has2","unshift","url","slice","console","logDate","toISOString","repeat","shift","reason","forEach","impls","pop","prototype","client_logToBuffer","logToBuffer","_default2"],"sources":["logger.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {inBrowser, patterns} from '@webex/common';\nimport {WebexHttpError, WebexPlugin} from '@webex/webex-core';\nimport {cloneDeep, has, isArray, isObject, isString} from 'lodash';\n\nconst precedence = {\n silent: 0,\n group: 1,\n groupEnd: 2,\n error: 3,\n warn: 4,\n log: 5,\n info: 6,\n debug: 7,\n trace: 8,\n};\n\nexport const levels = Object.keys(precedence).filter((level) => level !== 'silent');\n\nconst fallbacks = {\n error: ['log'],\n warn: ['error', 'log'],\n info: ['log'],\n debug: ['info', 'log'],\n trace: ['debug', 'info', 'log'],\n};\n\nconst LOG_TYPES = {\n SDK: 'sdk',\n CLIENT: 'client',\n};\n\nconst SDK_LOG_TYPE_NAME = 'wx-js-sdk';\n\nconst authTokenKeyPattern = /[Aa]uthorization/;\n\n/**\n * Recursively strips \"authorization\" fields from the specified object\n * @param {Object} object\n * @param {Array<mixed>} [visited]\n * @private\n * @returns {Object}\n */\nfunction walkAndFilter(object, visited = []) {\n if (visited.includes(object)) {\n // Prevent circular references\n return object;\n }\n\n visited.push(object);\n\n if (isArray(object)) {\n return object.map((o) => walkAndFilter(o, visited));\n }\n if (!isObject(object)) {\n if (isString(object)) {\n if (patterns.containsEmails.test(object)) {\n return object.replace(patterns.containsEmails, '[REDACTED]');\n }\n }\n\n return object;\n }\n\n for (const [key, value] of Object.entries(object)) {\n if (authTokenKeyPattern.test(key)) {\n Reflect.deleteProperty(object, key);\n } else {\n object[key] = walkAndFilter(value, visited);\n }\n }\n\n return object;\n}\n\n/**\n * @class\n */\nconst Logger = WebexPlugin.extend({\n namespace: 'Logger',\n\n derived: {\n level: {\n cache: false,\n fn() {\n return this.getCurrentLevel();\n },\n },\n client_level: {\n cache: false,\n fn() {\n return this.getCurrentClientLevel();\n },\n },\n },\n session: {\n // for when configured to use single buffer\n buffer: {\n type: 'array',\n default() {\n return [];\n },\n },\n groupLevel: {\n type: 'number',\n default() {\n return 0;\n },\n },\n // for when configured to use separate buffers\n sdkBuffer: {\n type: 'array',\n default() {\n return [];\n },\n },\n clientBuffer: {\n type: 'array',\n default() {\n return [];\n },\n },\n },\n\n /**\n * Ensures auth headers don't get printed in logs\n * @param {Array<mixed>} args\n * @private\n * @memberof Logger\n * @returns {Array<mixed>}\n */\n filter(...args) {\n return args.map((arg) => {\n // WebexHttpError already ensures auth tokens don't get printed, so, no\n // need to alter it here.\n if (arg instanceof Error) {\n // karma logs won't print subclassed errors correctly, so we need\n // explicitly call their tostring methods.\n if (process.env.NODE_ENV === 'test' && inBrowser) {\n let ret = arg.toString();\n\n ret += 'BEGIN STACK';\n ret += arg.stack;\n ret += 'END STACK';\n\n return ret;\n }\n\n return arg;\n }\n\n arg = cloneDeep(arg);\n\n return walkAndFilter(arg);\n });\n },\n\n /**\n * Determines if the current level allows logs at the specified level to be\n * printed\n * @param {string} level\n * @param {string} type type of log, SDK or client\n * @private\n * @memberof Logger\n * @returns {boolean}\n */\n shouldPrint(level, type = LOG_TYPES.SDK) {\n return (\n precedence[level] <=\n precedence[type === LOG_TYPES.SDK ? this.getCurrentLevel() : this.getCurrentClientLevel()]\n );\n },\n\n /**\n * Determines if the current level allows logs at the specified level to be\n * put into the log buffer. We're configuring it omit trace and debug logs\n * because there are *a lot* of debug logs that really don't provide value at\n * runtime (they're helpful for debugging locally, but really just pollute the\n * uploaded logs and push useful info out).\n * @param {string} level\n * @param {string} type type of log, SDK or client\n * @private\n * @memberof Logger\n * @returns {boolean}\n */\n shouldBuffer(level) {\n return (\n precedence[level] <=\n (this.config.bufferLogLevel ? precedence[this.config.bufferLogLevel] : precedence.info)\n );\n },\n\n /**\n * Indicates the current SDK log level based on env vars, feature toggles, and\n * user type.\n * @instance\n * @memberof Logger\n * @private\n * @memberof Logger\n * @returns {string}\n */\n // eslint-disable-next-line complexity\n getCurrentLevel() {\n // If a level has been explicitly set via config, alway use it.\n if (this.config.level) {\n return this.config.level;\n }\n\n if (levels.includes(process.env.WEBEX_LOG_LEVEL)) {\n return process.env.WEBEX_LOG_LEVEL;\n }\n\n // Always use debug-level logging in test mode;\n if (process.env.NODE_ENV === 'test') {\n return 'trace';\n }\n\n // Use server-side-feature toggles to configure log levels\n const level =\n this.webex.internal.device && this.webex.internal.device.features.developer.get('log-level');\n\n if (level) {\n if (levels.includes(level)) {\n return level;\n }\n }\n\n return 'error';\n },\n\n /**\n * Indicates the current client log level based on config, defaults to SDK level\n * @instance\n * @memberof Logger\n * @private\n * @memberof Logger\n * @returns {string}\n */\n getCurrentClientLevel() {\n // If a client log level has been explicitly set via config, alway use it.\n if (this.config.clientLevel) {\n return this.config.clientLevel;\n }\n\n // otherwise default to SDK level\n return this.getCurrentLevel();\n },\n\n /**\n * Format logs (for upload)\n *\n * If separate client, SDK buffers is configured, merge the buffers, if configured\n *\n * @instance\n * @memberof Logger\n * @public\n * @memberof Logger\n * @returns {string} formatted buffer\n */\n formatLogs() {\n function getDate(log) {\n return log[1];\n }\n let buffer = [];\n let clientIndex = 0;\n let sdkIndex = 0;\n\n if (this.config.separateLogBuffers) {\n // merge the client and sdk buffers\n // while we have entries in either buffer\n while (clientIndex < this.clientBuffer.length || sdkIndex < this.sdkBuffer.length) {\n // if we have remaining entries in the SDK buffer\n if (\n sdkIndex < this.sdkBuffer.length &&\n // and we haven't exhausted all the client buffer entries, or SDK date is before client date\n (clientIndex >= this.clientBuffer.length ||\n new Date(getDate(this.sdkBuffer[sdkIndex])) <=\n new Date(getDate(this.clientBuffer[clientIndex])))\n ) {\n // then add to the SDK buffer\n buffer.push(this.sdkBuffer[sdkIndex]);\n sdkIndex += 1;\n }\n // otherwise if we haven't exhausted all the client buffer entries, add client entry, whether it was because\n // it was the only remaining entries or date was later (the above if)\n else if (clientIndex < this.clientBuffer.length) {\n buffer.push(this.clientBuffer[clientIndex]);\n clientIndex += 1;\n }\n }\n } else {\n buffer = this.buffer;\n }\n\n return buffer.join('\\n');\n },\n});\n\n/**\n * Creates a logger method\n *\n *\n * @param {string} level level to create (info, error, warn, etc.)\n * @param {string} impl the level to use when writing to console\n * @param {string} type type of log, SDK or client\n * @param {bool} neverPrint function never prints to console\n * @param {bool} alwaysBuffer function always logs to log buffer\n * @instance\n * @memberof Logger\n * @private\n * @memberof Logger\n * @returns {function} logger method with specified params\n */\nfunction makeLoggerMethod(level, impl, type, neverPrint = false, alwaysBuffer = false) {\n // Much of the complexity in the following function is due to a test-mode-only\n // helper\n return function wrappedConsoleMethod(...args) {\n // it would be easier to just pass in the name and buffer here, but the config isn't completely initialized\n // in Ampersand, even if the initialize method is used to set this up. so we keep the type to achieve\n // a sort of late binding to allow retrieving a name from config.\n const logType = type;\n const clientName =\n logType === LOG_TYPES.SDK ? SDK_LOG_TYPE_NAME : this.config.clientName || logType;\n\n let buffer;\n let historyLength;\n\n if (this.config.separateLogBuffers) {\n historyLength = this.config.clientHistoryLength\n ? this.config.clientHistoryLength\n : this.config.historyLength;\n buffer = logType === LOG_TYPES.SDK ? this.sdkBuffer : this.clientBuffer;\n } else {\n buffer = this.buffer;\n historyLength = this.config.historyLength;\n }\n\n try {\n const shouldPrint = !neverPrint && this.shouldPrint(level, logType);\n const shouldBuffer = alwaysBuffer || this.shouldBuffer(level);\n\n if (!shouldBuffer && !shouldPrint) {\n return;\n }\n\n const filtered = [clientName, ...this.filter(...args)];\n const stringified = filtered.map((item) => {\n if (item instanceof WebexHttpError) {\n return item.toString();\n }\n\n return item;\n });\n\n if (shouldPrint) {\n // when logging an object in browsers, we tend to get a dynamic\n // reference, thus going back to look at the logged value doesn't\n // necessarily show the state at log time, thus we print the stringified\n // value.\n const toPrint = inBrowser ? stringified : filtered;\n\n /* istanbul ignore if */\n if (process.env.NODE_ENV === 'test' && has(this, 'webex.internal.device.url')) {\n toPrint.unshift(this.webex.internal.device.url.slice(-3));\n }\n // eslint-disable-next-line no-console\n console[impl](...toPrint);\n }\n\n if (shouldBuffer) {\n const logDate = new Date();\n\n stringified.unshift(logDate.toISOString());\n stringified.unshift('| '.repeat(this.groupLevel));\n buffer.push(stringified);\n if (buffer.length > historyLength) {\n buffer.shift();\n }\n if (level === 'group') this.groupLevel += 1;\n if (level === 'groupEnd' && this.groupLevel > 0) this.groupLevel -= 1;\n }\n } catch (reason) {\n if (!neverPrint) {\n /* istanbul ignore next */\n // eslint-disable-next-line no-console\n console.warn(`failed to execute Logger#${level}`, reason);\n }\n }\n };\n}\n\nlevels.forEach((level) => {\n let impls = fallbacks[level];\n let impl = level;\n\n if (impls) {\n impls = impls.slice();\n // eslint-disable-next-line no-console\n while (!console[impl]) {\n impl = impls.pop();\n }\n }\n\n // eslint-disable-next-line complexity\n Logger.prototype[`client_${level}`] = makeLoggerMethod(level, impl, LOG_TYPES.CLIENT);\n Logger.prototype[level] = makeLoggerMethod(level, impl, LOG_TYPES.SDK);\n});\n\nLogger.prototype.client_logToBuffer = makeLoggerMethod(\n levels.info,\n levels.info,\n LOG_TYPES.CLIENT,\n true,\n true\n);\nLogger.prototype.logToBuffer = makeLoggerMethod(\n levels.info,\n levels.info,\n LOG_TYPES.SDK,\n true,\n true\n);\n\nexport default Logger;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAIA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AALA;AACA;AACA;;AAMA,IAAME,UAAU,GAAG;EACjBC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE,CAAC;EACRC,QAAQ,EAAE,CAAC;EACXC,KAAK,EAAE,CAAC;EACRC,IAAI,EAAE,CAAC;EACP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AAK,EAAEqF,IAAI,EAAElF,SAAS,CAACE,MAAM,CAAC;EACrF4B,MAAM,CAACkF,SAAS,CAACnH,KAAK,CAAC,GAAGoF,gBAAgB,CAACpF,KAAK,EAAEqF,IAAI,EAAElF,SAAS,CAACC,GAAG,CAAC;AACxE,CAAC,CAAC;AAEF6B,MAAM,CAACkF,SAAS,CAACC,kBAAkB,GAAGhC,gBAAgB,CACpDxF,MAAM,CAACH,IAAI,EACXG,MAAM,CAACH,IAAI,EACXU,SAAS,CAACE,MAAM,EAChB,IAAI,EACJ,IAAI,CACL;AACD4B,MAAM,CAACkF,SAAS,CAACE,WAAW,GAAGjC,gBAAgB,CAC7CxF,MAAM,CAACH,IAAI,EACXG,MAAM,CAACH,IAAI,EACXU,SAAS,CAACC,GAAG,EACb,IAAI,EACJ,IAAI,CACL;AAAC,IAAAkH,SAAA,GAEarF,MAAM;AAAAhC,OAAA,CAAAH,OAAA,GAAAwH,SAAA"}
|
package/jest.config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const config = require('@webex/jest-config-legacy');
|
|
2
|
-
|
|
3
|
-
module.exports = config;
|
|
1
|
+
const config = require('@webex/jest-config-legacy');
|
|
2
|
+
|
|
3
|
+
module.exports = config;
|