@koralabs/kora-labs-common 1.0.7 → 1.0.8
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/environment/index.js +0 -3
- package/lib/logger/index.js +10 -5
- package/lib/logger/index.test.js +1 -0
- package/package.json +1 -1
package/lib/environment/index.js
CHANGED
|
@@ -96,9 +96,6 @@ class Environment {
|
|
|
96
96
|
static getPotentialApplicationName() {
|
|
97
97
|
var _a, _b;
|
|
98
98
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
if (process.env.NODE_ENV == 'test') {
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
99
|
if (process.env.APPLICATION_NAME) {
|
|
103
100
|
return process.env.APPLICATION_NAME;
|
|
104
101
|
}
|
package/lib/logger/index.js
CHANGED
|
@@ -37,12 +37,17 @@ var LogCategory;
|
|
|
37
37
|
class Logger {
|
|
38
38
|
static initialize() {
|
|
39
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
if (process.env.NODE_ENV !== 'test') {
|
|
41
|
+
if (!Logger.application) {
|
|
42
|
+
const potentialName = yield environment_1.Environment.getPotentialApplicationName();
|
|
43
|
+
if (!potentialName) {
|
|
44
|
+
throw new Error('Logger.application must be set!');
|
|
45
|
+
}
|
|
46
|
+
Logger.application = potentialName;
|
|
44
47
|
}
|
|
45
|
-
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
Logger.application = 'TEST';
|
|
46
51
|
}
|
|
47
52
|
Logger.isInitialized = true;
|
|
48
53
|
});
|
package/lib/logger/index.test.js
CHANGED