@dashevo/dapi-client 0.25.20 → 0.25.22
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/lib/DAPIClient.js
CHANGED
|
@@ -34,6 +34,7 @@ class DAPIClient extends EventEmitter {
|
|
|
34
34
|
blockHeadersProviderOptions: BlockHeadersProvider.defaultOptions,
|
|
35
35
|
loggerOptions: {
|
|
36
36
|
identifier: '',
|
|
37
|
+
level: undefined,
|
|
37
38
|
},
|
|
38
39
|
...options,
|
|
39
40
|
};
|
|
@@ -57,7 +58,10 @@ class DAPIClient extends EventEmitter {
|
|
|
57
58
|
|
|
58
59
|
this.core = new CoreMethodsFacade(jsonRpcTransport, grpcTransport);
|
|
59
60
|
this.platform = new PlatformMethodsFacade(grpcTransport);
|
|
60
|
-
this.logger = logger.getForId(
|
|
61
|
+
this.logger = logger.getForId(
|
|
62
|
+
this.options.loggerOptions.identifier,
|
|
63
|
+
this.options.loggerOptions.level,
|
|
64
|
+
);
|
|
61
65
|
|
|
62
66
|
this.initBlockHeadersProvider();
|
|
63
67
|
}
|
|
@@ -89,6 +93,7 @@ DAPIClient.EVENTS = EVENTS;
|
|
|
89
93
|
* @property {boolean} [throwDeadlineExceeded]
|
|
90
94
|
* @property {object} [loggerOptions]
|
|
91
95
|
* @property {string} [loggerOptions.identifier]
|
|
96
|
+
* @property {string} [loggerOptions.level]
|
|
92
97
|
* @property {BlockHeadersProvider} [blockHeadersProvider]
|
|
93
98
|
* @property {BlockHeadersProviderOptions} [blockHeadersProviderOptions]
|
|
94
99
|
*/
|
package/lib/logger/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
const util = require('util');
|
|
2
2
|
const winston = require('winston');
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// TODO: Refactor to use params instead on envs
|
|
5
|
+
|
|
6
|
+
const LOG_LEVEL = process.env.LOG_LEVEL || 'silent';
|
|
5
7
|
const LOG_TO_FILE = process.env.LOG_WALLET_TO_FILE || 'false';
|
|
6
8
|
|
|
7
9
|
// Log levels:
|
|
@@ -36,6 +38,7 @@ const createLogger = (formats = [], id = '') => {
|
|
|
36
38
|
const transports = [
|
|
37
39
|
new winston.transports.Console({
|
|
38
40
|
format,
|
|
41
|
+
silent: LOG_LEVEL === 'silent',
|
|
39
42
|
}),
|
|
40
43
|
];
|
|
41
44
|
|
|
@@ -44,6 +47,7 @@ const createLogger = (formats = [], id = '') => {
|
|
|
44
47
|
new winston.transports.File({
|
|
45
48
|
filename: `wallet${id !== '' ? `_${id}` : ''}`,
|
|
46
49
|
format,
|
|
50
|
+
silent: LOG_LEVEL === 'silent',
|
|
47
51
|
}),
|
|
48
52
|
);
|
|
49
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-client",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.22",
|
|
4
4
|
"description": "Client library used to access Dash DAPI endpoints",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"contributors": [
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
}
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dashevo/dapi-grpc": "0.25.
|
|
30
|
-
"@dashevo/dash-spv": "0.25.
|
|
29
|
+
"@dashevo/dapi-grpc": "0.25.22",
|
|
30
|
+
"@dashevo/dash-spv": "0.25.22",
|
|
31
31
|
"@dashevo/dashcore-lib": "~0.21.0",
|
|
32
|
-
"@dashevo/grpc-common": "0.25.
|
|
33
|
-
"@dashevo/wasm-dpp": "0.25.
|
|
32
|
+
"@dashevo/grpc-common": "0.25.22",
|
|
33
|
+
"@dashevo/wasm-dpp": "0.25.22",
|
|
34
34
|
"bs58": "^4.0.1",
|
|
35
35
|
"cbor": "^8.0.0",
|
|
36
36
|
"google-protobuf": "^3.12.2",
|