modality-kit 0.10.2 → 0.11.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.
- package/dist/index.js +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -81,14 +81,15 @@ var levels = ["debug", "info", "warn", "error", "success"];
|
|
|
81
81
|
|
|
82
82
|
class ModalityLogger {
|
|
83
83
|
options = {};
|
|
84
|
-
logLevel
|
|
85
|
-
constructor(logOption, logLevel
|
|
84
|
+
logLevel;
|
|
85
|
+
constructor(logOption, logLevel) {
|
|
86
86
|
if (typeof logOption === "string") {
|
|
87
87
|
this.options.name = logOption;
|
|
88
88
|
} else {
|
|
89
89
|
this.options = { ...this.options, ...logOption };
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
const processEnvLogLevel = process.env.MODALITY_LOG_LEVEL;
|
|
92
|
+
this.logLevel = logLevel || (levels.indexOf(processEnvLogLevel) !== -1 ? processEnvLogLevel : "info");
|
|
92
93
|
}
|
|
93
94
|
static getInstance(logOption, logLevel) {
|
|
94
95
|
return new ModalityLogger(logOption, logLevel);
|
|
@@ -222,7 +223,7 @@ class ModalityLogger {
|
|
|
222
223
|
}
|
|
223
224
|
var getLoggerInstance = ModalityLogger.getInstance.bind(ModalityLogger);
|
|
224
225
|
// src/util_error.ts
|
|
225
|
-
var logger = getLoggerInstance("
|
|
226
|
+
var logger = getLoggerInstance("Safe to Handle");
|
|
226
227
|
|
|
227
228
|
class ErrorCode extends Error {
|
|
228
229
|
cause;
|
package/package.json
CHANGED