@typeberry/convert 0.4.1-ac232ea → 0.4.1-b66435f
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/index.js +14 -6
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4133,8 +4133,7 @@ class InfoConsoleTransport extends ConsoleTransport {
|
|
|
4133
4133
|
}
|
|
4134
4134
|
}
|
|
4135
4135
|
|
|
4136
|
-
;// CONCATENATED MODULE: ./packages/core/logger/
|
|
4137
|
-
|
|
4136
|
+
;// CONCATENATED MODULE: ./packages/core/logger/logger.ts
|
|
4138
4137
|
|
|
4139
4138
|
|
|
4140
4139
|
const DEFAULT_OPTIONS = {
|
|
@@ -4175,13 +4174,13 @@ class Logger {
|
|
|
4175
4174
|
*
|
|
4176
4175
|
* Changing the options affects all previously created loggers.
|
|
4177
4176
|
*/
|
|
4178
|
-
static configureAllFromOptions(options) {
|
|
4177
|
+
static configureAllFromOptions(options, createTransport = ConsoleTransport.create) {
|
|
4179
4178
|
// find minimal level to optimise logging in case
|
|
4180
4179
|
// we don't care about low-level logs.
|
|
4181
4180
|
const minimalLevel = Array.from(options.modules.values()).reduce((level, modLevel) => {
|
|
4182
4181
|
return level < modLevel ? level : modLevel;
|
|
4183
4182
|
}, options.defaultLevel);
|
|
4184
|
-
const transport =
|
|
4183
|
+
const transport = createTransport(minimalLevel, options);
|
|
4185
4184
|
// set the global config
|
|
4186
4185
|
GLOBAL_CONFIG.options = options;
|
|
4187
4186
|
GLOBAL_CONFIG.transport = transport;
|
|
@@ -4207,8 +4206,11 @@ class Logger {
|
|
|
4207
4206
|
}
|
|
4208
4207
|
getLevelAndName() {
|
|
4209
4208
|
if (this.cachedLevelAndName === undefined) {
|
|
4210
|
-
|
|
4211
|
-
|
|
4209
|
+
// since we pad module name for better alignment, we need to
|
|
4210
|
+
// trim it for the lookup
|
|
4211
|
+
const moduleTrimmed = this.moduleName.trim();
|
|
4212
|
+
const level = findLevel(this.config.options, moduleTrimmed);
|
|
4213
|
+
const shortName = moduleTrimmed.replace(this.config.options.workingDir, "");
|
|
4212
4214
|
this.cachedLevelAndName = [level, shortName];
|
|
4213
4215
|
}
|
|
4214
4216
|
return this.cachedLevelAndName;
|
|
@@ -4239,6 +4241,12 @@ class Logger {
|
|
|
4239
4241
|
}
|
|
4240
4242
|
}
|
|
4241
4243
|
|
|
4244
|
+
;// CONCATENATED MODULE: ./packages/core/logger/index.ts
|
|
4245
|
+
|
|
4246
|
+
|
|
4247
|
+
|
|
4248
|
+
|
|
4249
|
+
|
|
4242
4250
|
;// CONCATENATED MODULE: ./packages/core/utils/env.ts
|
|
4243
4251
|
const env = typeof process === "undefined" ? {} : process.env;
|
|
4244
4252
|
|