@wdio/logger 8.24.12 → 8.38.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAGA,OAAO,GAAG,MAAM,UAAU,CAAA;AAsD1B,UAAU,eAAgB,SAAQ,GAAG,CAAC,MAAM;IACxC,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;CACjC;AA2ED,iBAAwB,SAAS,CAAE,IAAI,EAAE,MAAM,mBAyB9C;kBAzBuB,SAAS;;;;;;eAAT,SAAS;AAiFjC,MAAM,MAAM,MAAM,GAAG,eAAe,CAAA"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAGA,OAAO,GAAG,MAAM,UAAU,CAAA;AAsD1B,UAAU,eAAgB,SAAQ,GAAG,CAAC,MAAM;IACxC,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;CACjC;AA+ED,iBAAwB,SAAS,CAAE,IAAI,EAAE,MAAM,mBAyB9C;kBAzBuB,SAAS;;;;;;eAAT,SAAS;AAiFjC,MAAM,MAAM,MAAM,GAAG,eAAe,CAAA"}
package/build/node.js CHANGED
@@ -92,7 +92,11 @@ const wdioLoggerMethodFactory = function (methodName, logLevel, loggerName) {
92
92
  });
93
93
  logCache.clear();
94
94
  }
95
- return logFile.write(logText);
95
+ if (!logsContainInitPackageError(logText)) {
96
+ return logFile.write(logText);
97
+ }
98
+ // If we get Error during init of integration packages, write logs to both "outputDir" and the terminal
99
+ logFile.write(logText);
96
100
  }
97
101
  logCache.add(logText);
98
102
  rawMethod(...args);
@@ -104,7 +108,7 @@ const progress = function (data) {
104
108
  const timestampFormatter = chalk.gray(new Date().toISOString());
105
109
  const levelFormatter = chalk[COLORS[level]](level.toUpperCase());
106
110
  const nameFormatter = chalk.whiteBright(this.name);
107
- const _data = data.length > 0 ? `${timestampFormatter} ${levelFormatter} ${nameFormatter}: ${data}` : '\r\x1b[K';
111
+ const _data = data.length > 0 ? `${timestampFormatter} ${levelFormatter} ${nameFormatter}: ${data}` : '\r\x1b[K\x1b[?25h';
108
112
  process.stdout.write('\u001B[?25l'); // Disable cursor in terminal
109
113
  process.stdout.write(`${_data}\r`);
110
114
  }
@@ -182,3 +186,12 @@ getLogger.setLogLevelsConfig = (logLevels = {}, wdioLogLevel = DEFAULT_LEVEL) =>
182
186
  });
183
187
  };
184
188
  const getLogLevelName = (logName) => logName.split(':').shift();
189
+ function logsContainInitPackageError(logText) {
190
+ return ERROR_LOG_VALIDATOR.every(pattern => logText.includes(pattern));
191
+ }
192
+ const ERROR_LOG_VALIDATOR = [
193
+ 'Couldn\'t find plugin',
194
+ 'neither as wdio scoped package',
195
+ 'nor as community package',
196
+ 'Please make sure you have it installed'
197
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/logger",
3
- "version": "8.24.12",
3
+ "version": "8.38.0",
4
4
  "description": "A helper utility for logging of WebdriverIO packages",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-logger",
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "ebf1ba1875fe210fda7067c1c13944c50cb6a694"
40
+ "gitHead": "b8ebe679c772a858709164896c6b5ea86a42b146"
41
41
  }