@vlian/framework 1.2.39 → 1.2.40

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @vlian/framework v1.2.38
2
+ * @vlian/framework v1.2.39
3
3
  * Secra Framework - 一个现代化的低代码框架
4
4
  * (c) 2026 Secra Framework Contributors
5
5
  * Licensed under Apache-2.0
package/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @vlian/framework v1.2.38
2
+ * @vlian/framework v1.2.39
3
3
  * Secra Framework - 一个现代化的低代码框架
4
4
  * (c) 2026 Secra Framework Contributors
5
5
  * Licensed under Apache-2.0
@@ -12340,9 +12340,16 @@
12340
12340
  class LoggerManager {
12341
12341
  async initialize(context) {
12342
12342
  this.config = context.config.logger;
12343
+ const configuredLevel = normalizeLogLevel(this.config.level, logger.LogLevel.INFO);
12343
12344
  const persisted = await readPersistedValue(this.config.persistence);
12344
- this.level = normalizeLogLevel(persisted, this.config.level ?? logger.LogLevel.INFO);
12345
+ if (persisted !== null) {
12346
+ this.level = normalizeLogLevel(persisted, configuredLevel);
12347
+ logger.logger.setLevel(this.level);
12348
+ return;
12349
+ }
12350
+ this.level = configuredLevel;
12345
12351
  logger.logger.setLevel(this.level);
12352
+ await writePersistedValue(this.config.persistence, String(this.level));
12346
12353
  }
12347
12354
  debug(message, payload) {
12348
12355
  logger.logger.debug(message, payload);
@@ -12434,7 +12441,7 @@
12434
12441
  ...this.config.initial || {}
12435
12442
  };
12436
12443
  const persisted = await readPersistedValue(this.config.persistence);
12437
- if (persisted) {
12444
+ if (persisted !== null) {
12438
12445
  try {
12439
12446
  const parsed = JSON.parse(persisted);
12440
12447
  this.theme = {
@@ -12444,6 +12451,8 @@
12444
12451
  } catch {
12445
12452
  // ignore parse errors
12446
12453
  }
12454
+ } else {
12455
+ await writePersistedValue(this.config.persistence, JSON.stringify(this.theme));
12447
12456
  }
12448
12457
  applyThemeToDocument(this.theme);
12449
12458
  }
@@ -12489,7 +12498,7 @@
12489
12498
  ...this.config.initial || {}
12490
12499
  };
12491
12500
  const persisted = await readPersistedValue(this.config.persistence);
12492
- if (persisted) {
12501
+ if (persisted !== null) {
12493
12502
  try {
12494
12503
  const parsed = JSON.parse(persisted);
12495
12504
  this.snapshot = {
@@ -12499,6 +12508,8 @@
12499
12508
  } catch {
12500
12509
  // ignore parse errors
12501
12510
  }
12511
+ } else {
12512
+ await writePersistedValue(this.config.persistence, JSON.stringify(this.snapshot));
12502
12513
  }
12503
12514
  setupI18n(this.snapshot.resources || {});
12504
12515
  setLang(this.snapshot.locale);
@@ -12666,7 +12677,7 @@
12666
12677
  ...DEFAULT_CONFIG.logger,
12667
12678
  ...loaded.logger,
12668
12679
  ...options.config?.logger || {},
12669
- level: options.loggerLevel || options.config?.logger?.level || loaded.logger?.level || DEFAULT_CONFIG.logger.level
12680
+ level: options.loggerLevel ?? options.config?.logger?.level ?? loaded.logger?.level ?? DEFAULT_CONFIG.logger.level
12670
12681
  },
12671
12682
  cache: {
12672
12683
  ...DEFAULT_CONFIG.cache,