@eclipse-che/che-e2e 7.73.0-dev-62c0c9d → 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.
- package/constants/BaseTestConstants.ts +2 -0
- package/dist/constants/BaseTestConstants.js +1 -0
- package/dist/constants/BaseTestConstants.js.map +1 -1
- package/dist/specs/api/PodOverridesAPI.spec.js +2 -1
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/utils/Logger.js +34 -19
- package/dist/utils/Logger.js.map +1 -1
- package/package.json +1 -1
- package/resources/pod-overrides-airgap.yaml +37 -0
- package/specs/api/PodOverridesAPI.spec.ts +2 -1
- package/utils/Logger.ts +40 -19
|
@@ -18,6 +18,8 @@ export const BaseTestConstants: any = {
|
|
|
18
18
|
*/
|
|
19
19
|
TS_SELENIUM_BASE_URL: !process.env.TS_SELENIUM_BASE_URL ? 'http://sample-url' : process.env.TS_SELENIUM_BASE_URL.replace(/\/$/, ''),
|
|
20
20
|
|
|
21
|
+
IS_CLUSTER_DISCONNECTED: () => BaseTestConstants.TS_SELENIUM_BASE_URL.includes('airgap'),
|
|
22
|
+
|
|
21
23
|
/**
|
|
22
24
|
* Choose the platform where "che" application deployed, "openshift" by default.
|
|
23
25
|
*/
|
|
@@ -20,6 +20,7 @@ exports.BaseTestConstants = {
|
|
|
20
20
|
* Base URL of the application which should be checked
|
|
21
21
|
*/
|
|
22
22
|
TS_SELENIUM_BASE_URL: !process.env.TS_SELENIUM_BASE_URL ? 'http://sample-url' : process.env.TS_SELENIUM_BASE_URL.replace(/\/$/, ''),
|
|
23
|
+
IS_CLUSTER_DISCONNECTED: () => exports.BaseTestConstants.TS_SELENIUM_BASE_URL.includes('airgap'),
|
|
23
24
|
/**
|
|
24
25
|
* Choose the platform where "che" application deployed, "openshift" by default.
|
|
25
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseTestConstants.js","sourceRoot":"","sources":["../../constants/BaseTestConstants.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;wEAQwE;AACxE,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,mCAAuB,CAAA;IACvB,qCAAyB,CAAA;AAC3B,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAEY,QAAA,iBAAiB,GAAQ;IACpC;;OAEG;IACH,oBAAoB,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IAEnI;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,QAAQ,CAAC,SAAS;IAE1D;;;OAGG;IACH,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,UAAU;IAEhE;;OAEG;IACH,kCAAkC,EAAE,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,cAAc;IAEpG;;OAEG;IACH,qCAAqC,EAAE,OAAO,CAAC,GAAG,CAAC,qCAAqC,IAAI,gBAAgB;IAE5G;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,OAAO;IAEnD;;OAEG;IACH,+BAA+B,EAAE,OAAO,CAAC,GAAG,CAAC,+BAA+B,KAAK,MAAM;IAEvF;;OAEG;IACH,gCAAgC,EAAE,OAAO,CAAC,GAAG,CAAC,gCAAgC,KAAK,MAAM;IAEzF;;OAEG;IACH,+BAA+B,EAAE,OAAO,CAAC,GAAG,CAAC,+BAA+B,KAAK,MAAM;IAEvF;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM;CACpD,CAAC"}
|
|
1
|
+
{"version":3,"file":"BaseTestConstants.js","sourceRoot":"","sources":["../../constants/BaseTestConstants.ts"],"names":[],"mappings":";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Default(require("path"));
|
|
|
9
9
|
const yaml_1 = __importDefault(require("yaml"));
|
|
10
10
|
const chai_1 = require("chai");
|
|
11
11
|
const ShellExecutor_1 = require("../../utils/ShellExecutor");
|
|
12
|
+
const BaseTestConstants_1 = require("../../constants/BaseTestConstants");
|
|
12
13
|
suite(`Test defining pod overrides via attribute.`, async function () {
|
|
13
|
-
const pathToSampleFile = path_1.default.resolve(
|
|
14
|
+
const pathToSampleFile = path_1.default.resolve(`resources/pod-overrides${BaseTestConstants_1.BaseTestConstants.IS_CLUSTER_DISCONNECTED() ? '-airgap' : ''}.yaml`);
|
|
14
15
|
const workspaceName = yaml_1.default.parse(fs_1.default.readFileSync(pathToSampleFile, 'utf8')).metadata.name;
|
|
15
16
|
const kubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor_1.KubernetesCommandLineToolsExecutor(workspaceName);
|
|
16
17
|
suiteSetup('Login into OC client', function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PodOverridesAPI.spec.js","sourceRoot":"","sources":["../../../specs/api/PodOverridesAPI.spec.ts"],"names":[],"mappings":";;;;;AAAA,uGAAoG;AACpG,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AACxB,+BAA8B;AAC9B,6DAA0D;
|
|
1
|
+
{"version":3,"file":"PodOverridesAPI.spec.js","sourceRoot":"","sources":["../../../specs/api/PodOverridesAPI.spec.ts"],"names":[],"mappings":";;;;;AAAA,uGAAoG;AACpG,4CAAoB;AACpB,gDAAwB;AACxB,gDAAwB;AACxB,+BAA8B;AAC9B,6DAA0D;AAC1D,yEAAsE;AAEtE,KAAK,CAAC,4CAA4C,EAAE,KAAK;IACvD,MAAM,gBAAgB,GAAW,cAAI,CAAC,OAAO,CAAC,0BAA0B,qCAAiB,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7I,MAAM,aAAa,GAAW,cAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;IAClG,MAAM,kCAAkC,GAAuC,IAAI,uEAAkC,CAAC,aAAa,CAAC,CAAC;IAErI,UAAU,CAAC,sBAAsB,EAAE;QACjC,kCAAkC,CAAC,UAAU,EAAE,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,aAAa,CAAC,qBAAqB,EAAE;QACnC,kCAAkC,CAAC,kBAAkB,EAAE,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,2DAA2D,EAAE;QAChE,kCAAkC,CAAC,4BAA4B,CAAC,gBAAgB,CAAC,CAAC;QAClF,6BAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,qEAAqE,EAAE;QAC1E,MAAM,0BAA0B,GAAQ,cAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,gCAAgC,EAAE,CAAC,CAAC;QAC1H,aAAM,CAAC,0BAA0B,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC;YAChF,QAAQ,EAAE;gBACR,WAAW,EAAE;oBACX,iCAAiC,EAAE,kCAAkC;oBACrE,qBAAqB,EAAE,MAAM;oBAC7B,kBAAkB,EAAE,iBAAiB;iBACtC;aACF;YACD,IAAI,EAAE;gBACJ,gBAAgB,EAAE,MAAM;gBACxB,aAAa,EAAE,OAAO;aACvB;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/utils/Logger.js
CHANGED
|
@@ -18,7 +18,9 @@ class Logger {
|
|
|
18
18
|
* @param indentLevel log level
|
|
19
19
|
*/
|
|
20
20
|
static error(text = '', indentLevel = 1) {
|
|
21
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
80
|
+
const callerInfo = this.getCallerInfo();
|
|
81
|
+
const logLevelSymbol = '‣ ';
|
|
82
|
+
this.logText(indentLevel, logLevelSymbol, `${this.getFullMessage(callerInfo, text)}`);
|
|
73
83
|
}
|
|
74
|
-
static
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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;
|
package/dist/utils/Logger.js.map
CHANGED
|
@@ -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,
|
|
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,MAAM,UAAU,GAAW,IAAI,CAAC,aAAa,EAAE,CAAC;QAChD,MAAM,cAAc,GAAW,UAAU,CAAC;QAC1C,IAAI,CAAC,OAAO,CACV,WAAW,EACX,cAAc,EACd,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAC3C,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,MAAM,UAAU,GAAW,IAAI,CAAC,aAAa,EAAE,CAAC;QAChD,MAAM,cAAc,GAAW,SAAS,CAAC;QACzC,IAAI,CAAC,OAAO,CACV,WAAW,EACX,cAAc,EACd,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAC3C,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,OAAe,EAAE,EAAE,cAAsB,CAAC;QACpD,IACE,qCAAiB,CAAC,qBAAq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AC,CAAC,EAAE,CAAC;IACzC,CAAC;CACF;AAnID,wBAmIC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
kind: DevWorkspace
|
|
2
|
+
apiVersion: workspace.devfile.io/v1alpha2
|
|
3
|
+
metadata:
|
|
4
|
+
name: code-latest-pod-overrides
|
|
5
|
+
spec:
|
|
6
|
+
started: true
|
|
7
|
+
template:
|
|
8
|
+
attributes:
|
|
9
|
+
pod-overrides:
|
|
10
|
+
metadata:
|
|
11
|
+
annotations:
|
|
12
|
+
io.openshift.userns: "true"
|
|
13
|
+
io.kubernetes.cri-o.userns-mode: "auto:size=65536;map-to-root=true" # <-- user namespace
|
|
14
|
+
openshift.io/scc: container-build
|
|
15
|
+
spec:
|
|
16
|
+
runtimeClassName: kata
|
|
17
|
+
schedulerName: stork
|
|
18
|
+
projects:
|
|
19
|
+
- name: web-nodejs-sample
|
|
20
|
+
git:
|
|
21
|
+
remotes:
|
|
22
|
+
origin: "https://github.com/che-samples/web-nodejs-sample.git"
|
|
23
|
+
commands:
|
|
24
|
+
- id: say-hello
|
|
25
|
+
exec:
|
|
26
|
+
component: che-code-runtime-description
|
|
27
|
+
commandLine: echo "Hello from $(pwd)"
|
|
28
|
+
workingDir: ${PROJECT_SOURCE}/app
|
|
29
|
+
contributions:
|
|
30
|
+
- name: che-code
|
|
31
|
+
uri: http://plugin-registry.openshift-devspaces.svc.cluster.local:8080/v3/plugins/che-incubator/che-code/latest/devfile.yaml
|
|
32
|
+
components:
|
|
33
|
+
- name: che-code-runtime-description
|
|
34
|
+
container:
|
|
35
|
+
env:
|
|
36
|
+
- name: CODE_HOST
|
|
37
|
+
value: 0.0.0.0
|
|
@@ -4,9 +4,10 @@ import path from 'path';
|
|
|
4
4
|
import YAML from 'yaml';
|
|
5
5
|
import { expect } from 'chai';
|
|
6
6
|
import { ShellExecutor } from '../../utils/ShellExecutor';
|
|
7
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
7
8
|
|
|
8
9
|
suite(`Test defining pod overrides via attribute.`, async function(): Promise<void> {
|
|
9
|
-
const pathToSampleFile: string = path.resolve(
|
|
10
|
+
const pathToSampleFile: string = path.resolve(`resources/pod-overrides${BaseTestConstants.IS_CLUSTER_DISCONNECTED() ? '-airgap' : ''}.yaml`);
|
|
10
11
|
const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name;
|
|
11
12
|
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(workspaceName);
|
|
12
13
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
108
|
+
logLevelSymbol,
|
|
109
|
+
`${this.getFullMessage(callerInfo, text)}`
|
|
95
110
|
);
|
|
96
111
|
}
|
|
97
112
|
|
|
98
|
-
private static
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
}
|