@eclipse-che/che-e2e 7.73.0-dev-ed57855 → 7.73.0-dev-2f46491

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.
@@ -18,7 +18,9 @@ class Logger {
18
18
  * @param indentLevel log level
19
19
  */
20
20
  static error(text = '', indentLevel = 1) {
21
- this.logText(indentLevel, `[ERROR] ${this.getCallerInfo()} ${this.separator(text)} ${text}`);
21
+ const callerInfo = this.getCallerInfo();
22
+ const logLevelSymbol = '[ERROR] ';
23
+ this.logText(indentLevel, logLevelSymbol, `${this.getFullMessage(callerInfo, text)}`);
22
24
  }
23
25
  /**
24
26
  * Uses for logging of recoverable errors and general warnings.
@@ -29,7 +31,9 @@ class Logger {
29
31
  if (ReporterConstants_1.ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'ERROR') {
30
32
  return;
31
33
  }
32
- this.logText(indentLevel, `[WARN] ${this.getCallerInfo()} ${this.separator(text)} ${text}`);
34
+ const callerInfo = this.getCallerInfo();
35
+ const logLevelSymbol = '[WARN] ';
36
+ this.logText(indentLevel, logLevelSymbol, `${this.getFullMessage(callerInfo, text)}`);
33
37
  }
34
38
  /**
35
39
  * Uses for logging of the public methods of the pageobjects.
@@ -41,7 +45,9 @@ class Logger {
41
45
  ReporterConstants_1.ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'WARN') {
42
46
  return;
43
47
  }
44
- this.logText(indentLevel, `• ${this.getCallerInfo()} ${this.separator(text)} ${text}`);
48
+ const callerInfo = this.getCallerInfo();
49
+ const logLevelSymbol = '• ';
50
+ this.logText(indentLevel, logLevelSymbol, `${this.getFullMessage(callerInfo, text)}`);
45
51
  }
46
52
  /**
47
53
  * Uses for logging of the public methods of the pageobjects.
@@ -54,7 +60,9 @@ class Logger {
54
60
  ReporterConstants_1.ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'INFO') {
55
61
  return;
56
62
  }
57
- this.logText(indentLevel, `▼ ${this.getCallerInfo()} ${this.separator(text)} ${text}`);
63
+ const callerInfo = this.getCallerInfo();
64
+ const logLevelSymbol = '▼ ';
65
+ this.logText(indentLevel, logLevelSymbol, `${this.getFullMessage(callerInfo, text)}`);
58
66
  }
59
67
  /**
60
68
  * Uses for logging of the public methods of the {@link DriverHelper} or
@@ -69,29 +77,36 @@ class Logger {
69
77
  ReporterConstants_1.ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'DEBUG') {
70
78
  return;
71
79
  }
72
- this.logText(indentLevel, `‣ ${this.getCallerInfo()} ${this.separator(text)} ${text}`);
80
+ const callerInfo = this.getCallerInfo();
81
+ const logLevelSymbol = '‣ ';
82
+ this.logText(indentLevel, logLevelSymbol, `${this.getFullMessage(callerInfo, text)}`);
73
83
  }
74
- static logText(messageIndentationLevel, text) {
75
- // start group for every level
76
- for (let i = 0; i < messageIndentationLevel; i++) {
77
- console.group();
78
- }
79
- // print the trimmed text
80
- // if multiline, the message should be properly padded
81
- console.log(text);
82
- // end group for every level
83
- for (let i = 0; i < messageIndentationLevel; i++) {
84
- console.groupEnd();
84
+ static getFullMessage(callerInfo, text) {
85
+ return `${callerInfo}${this.separator(text, callerInfo)}${text}`;
86
+ }
87
+ static logText(messageIndentationLevel, logLevelSymbol, text) {
88
+ if (text) {
89
+ // start group for every level
90
+ for (let i = 0; i < messageIndentationLevel; i++) {
91
+ console.group();
92
+ }
93
+ // print the trimmed text
94
+ // if multiline, the message should be properly padded
95
+ console.log(logLevelSymbol + text);
96
+ // end group for every level
97
+ for (let i = 0; i < messageIndentationLevel; i++) {
98
+ console.groupEnd();
99
+ }
85
100
  }
86
101
  }
87
102
  static getCallerInfo() {
88
103
  const e = new Error();
89
104
  const stack = e.stack ? e.stack.split('\n') : [];
90
105
  // " at functionName ( ..." => "functionName"
91
- return stack[3].replace(/^\s+at\s+(.+?)\s.+/g, '$1');
106
+ return stack[3].includes('.<anonymous') ? '' : stack[3].replace(/^\s+at\s+(.+?)\s.+/g, '$1');
92
107
  }
93
- static separator(text) {
94
- return text ? '-' : '';
108
+ static separator(text, caller) {
109
+ return text ? caller ? ' - ' : '' : '';
95
110
  }
96
111
  }
97
112
  exports.Logger = Logger;
@@ -1 +1 @@
1
- {"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../utils/Logger.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;wEAQwE;AACxE,sEAAmE;AAEnE,MAAsB,MAAM;IAC1B;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,OAAe,EAAE,EAAE,cAAsB,CAAC;QACrD,IAAI,CAAC,OAAO,CACV,WAAW,EACX,WAAW,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAClE,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,OAAe,EAAE,EAAE,cAAsB,CAAC;QACpD,IAAI,qCAAiB,CAAC,qBAAqB,KAAK,OAAO,EAAE;YACvD,OAAO;SACR;QACD,IAAI,CAAC,OAAO,CACV,WAAW,EACX,UAAU,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CACjE,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,OAAe,EAAE,EAAE,cAAsB,CAAC;QACpD,IACE,qCAAiB,CAAC,qBAAqB,KAAK,OAAO;YACnD,qCAAiB,CAAC,qBAAqB,KAAK,MAAM,EAClD;YACA,OAAO;SACR;QACD,IAAI,CAAC,OAAO,CACV,WAAW,EACX,KAAK,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAC5D,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,OAAe,EAAE,EAAE,cAAsB,CAAC;QACrD,IACE,qCAAiB,CAAC,qBAAqB,KAAK,OAAO;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CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACzC,CAAC;CACF;AAnID,wBAmIC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-che/che-e2e",
3
- "version": "7.73.0-dev-ed57855",
3
+ "version": "7.73.0-dev-2f46491",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/utils/Logger.ts CHANGED
@@ -16,9 +16,12 @@ export abstract class Logger {
16
16
  * @param indentLevel log level
17
17
  */
18
18
  static error(text: string = '', indentLevel: number = 1): void {
19
+ const callerInfo: string = this.getCallerInfo();
20
+ const logLevelSymbol: string = '[ERROR] ';
19
21
  this.logText(
20
22
  indentLevel,
21
- `[ERROR] ${this.getCallerInfo()} ${this.separator(text)} ${text}`
23
+ logLevelSymbol,
24
+ `${this.getFullMessage(callerInfo, text)}`
22
25
  );
23
26
  }
24
27
 
@@ -31,9 +34,12 @@ export abstract class Logger {
31
34
  if (ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'ERROR') {
32
35
  return;
33
36
  }
37
+ const callerInfo: string = this.getCallerInfo();
38
+ const logLevelSymbol: string = '[WARN] ';
34
39
  this.logText(
35
40
  indentLevel,
36
- `[WARN] ${this.getCallerInfo()} ${this.separator(text)} ${text}`
41
+ logLevelSymbol,
42
+ `${this.getFullMessage(callerInfo, text)}`
37
43
  );
38
44
  }
39
45
 
@@ -49,9 +55,12 @@ export abstract class Logger {
49
55
  ) {
50
56
  return;
51
57
  }
58
+ const callerInfo: string = this.getCallerInfo();
59
+ const logLevelSymbol: string = '• ';
52
60
  this.logText(
53
61
  indentLevel,
54
- `• ${this.getCallerInfo()} ${this.separator(text)} ${text}`
62
+ logLevelSymbol,
63
+ `${this.getFullMessage(callerInfo, text)}`
55
64
  );
56
65
  }
57
66
 
@@ -68,9 +77,12 @@ export abstract class Logger {
68
77
  ) {
69
78
  return;
70
79
  }
80
+ const callerInfo: string = this.getCallerInfo();
81
+ const logLevelSymbol: string = '▼ ';
71
82
  this.logText(
72
83
  indentLevel,
73
- `▼ ${this.getCallerInfo()} ${this.separator(text)} ${text}`
84
+ logLevelSymbol,
85
+ `${this.getFullMessage(callerInfo, text)}`
74
86
  );
75
87
  }
76
88
 
@@ -89,23 +101,32 @@ export abstract class Logger {
89
101
  ) {
90
102
  return;
91
103
  }
104
+ const callerInfo: string = this.getCallerInfo();
105
+ const logLevelSymbol: string = '‣ ';
92
106
  this.logText(
93
107
  indentLevel,
94
- `‣ ${this.getCallerInfo()} ${this.separator(text)} ${text}`
108
+ logLevelSymbol,
109
+ `${this.getFullMessage(callerInfo, text)}`
95
110
  );
96
111
  }
97
112
 
98
- private static logText(messageIndentationLevel: number, text: string): void {
99
- // start group for every level
100
- for (let i: number = 0; i < messageIndentationLevel; i++) {
101
- console.group();
102
- }
103
- // print the trimmed text
104
- // if multiline, the message should be properly padded
105
- console.log(text);
106
- // end group for every level
107
- for (let i: number = 0; i < messageIndentationLevel; i++) {
108
- console.groupEnd();
113
+ private static getFullMessage(callerInfo: string, text: string): string {
114
+ return `${callerInfo}${this.separator(text, callerInfo)}${text}`;
115
+ }
116
+
117
+ private static logText(messageIndentationLevel: number, logLevelSymbol: string, text: string): void {
118
+ if (text) {
119
+ // start group for every level
120
+ for (let i: number = 0; i < messageIndentationLevel; i++) {
121
+ console.group();
122
+ }
123
+ // print the trimmed text
124
+ // if multiline, the message should be properly padded
125
+ console.log(logLevelSymbol + text);
126
+ // end group for every level
127
+ for (let i: number = 0; i < messageIndentationLevel; i++) {
128
+ console.groupEnd();
129
+ }
109
130
  }
110
131
  }
111
132
 
@@ -113,10 +134,10 @@ export abstract class Logger {
113
134
  const e: Error = new Error();
114
135
  const stack: string[] = e.stack ? e.stack.split('\n') : [];
115
136
  // " at functionName ( ..." => "functionName"
116
- return stack[3].replace(/^\s+at\s+(.+?)\s.+/g, '$1');
137
+ return stack[3].includes('.<anonymous') ? '' : stack[3].replace(/^\s+at\s+(.+?)\s.+/g, '$1');
117
138
  }
118
139
 
119
- private static separator(text: string): string {
120
- return text ? '-' : '';
140
+ private static separator(text: string, caller: string): string {
141
+ return text ? caller ? ' - ' : '' : '';
121
142
  }
122
143
  }