@testomatio/reporter 1.3.0-beta → 1.3.1-beta
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/logger.js +8 -1
- package/package.json +2 -1
package/lib/logger.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
2
|
const debug = require('debug')('@testomatio/reporter:logger');
|
|
3
|
+
const _ = require('lodash');
|
|
3
4
|
const { DataStorage } = require('./dataStorage');
|
|
4
5
|
|
|
5
6
|
const LOG_METHODS = ['assert', 'debug', 'error', 'info', 'log', 'trace', 'warn'];
|
|
@@ -241,6 +242,11 @@ class Logger {
|
|
|
241
242
|
debug(`Try to intercept console, but it is already intercepted`);
|
|
242
243
|
return;
|
|
243
244
|
}
|
|
245
|
+
// prevent other loggers multiple interceptions
|
|
246
|
+
if (_.isEqual(userLogger, this._originalUserLogger)) {
|
|
247
|
+
debug(`Try to intercept user logger, but it is already intercepted`);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
244
250
|
|
|
245
251
|
process.env.TESTOMATIO_LOGGER_CONSOLE_INTERCEPTED = 'true';
|
|
246
252
|
debug(isUserLoggerConsole ? 'console intercepted' : 'User logger intercepted');
|
|
@@ -250,7 +256,8 @@ class Logger {
|
|
|
250
256
|
(for other frameworks user logger will be passed for output) */
|
|
251
257
|
if (this.dataStorage.runningEnvironment !== 'playwright') {
|
|
252
258
|
// save original user logger to use it for logging (last intercepted will be used for console output)
|
|
253
|
-
|
|
259
|
+
//! TODO: temporary don't oeverride user logger to prevent recursion; console will be used for output
|
|
260
|
+
// this._originalUserLogger = { ...userLogger };
|
|
254
261
|
}
|
|
255
262
|
this._loggerToIntercept = userLogger;
|
|
256
263
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testomatio/reporter",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1-beta",
|
|
4
4
|
"description": "Testomatio Reporter Client",
|
|
5
5
|
"main": "./lib/reporter.js",
|
|
6
6
|
"typings": "typings/index.d.ts",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"humanize-duration": "^3.27.3",
|
|
26
26
|
"is-valid-path": "^0.1.1",
|
|
27
27
|
"json-cycle": "^1.3.0",
|
|
28
|
+
"lodash": "^4.17.21",
|
|
28
29
|
"lodash.memoize": "^4.1.2",
|
|
29
30
|
"lodash.merge": "^4.6.2",
|
|
30
31
|
"uuid": "^9.0.0"
|