@hkdigital/lib-sveltekit 0.2.12 → 0.2.13

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.
@@ -134,7 +134,7 @@ export class ServiceManager extends EventEmitter {
134
134
  */
135
135
  getServicesByTag(tag: string): string[];
136
136
  /**
137
- * Setup logging configuration based on environment
137
+ * Setup logging configuration based on config.dev
138
138
  *
139
139
  * @private
140
140
  */
@@ -13,7 +13,7 @@
13
13
  * import AuthService from './services/AuthService.js';
14
14
  *
15
15
  * const manager = new ServiceManager({
16
- * environment: 'development',
16
+ * debug: true,
17
17
  * stopTimeout: 10000
18
18
  * });
19
19
  *
@@ -103,7 +103,7 @@ export class ServiceManager extends EventEmitter {
103
103
 
104
104
  /** @type {ServiceManagerConfig} */
105
105
  this.config = {
106
- environment: config.environment || 'production',
106
+ debug: config.debug ?? false,
107
107
  autoStart: config.autoStart ?? false,
108
108
  stopTimeout: config.stopTimeout || 10000,
109
109
  logConfig: config.logConfig || {}
@@ -449,7 +449,8 @@ export class ServiceManager extends EventEmitter {
449
449
  this.config.logConfig.globalLevel = level;
450
450
 
451
451
  // Apply to all existing services
452
- for (const [serviceName, entry] of this.services) {
452
+ // eslint-disable-next-line no-unused-vars
453
+ for (const [_, entry] of this.services) {
453
454
  if (entry.instance) {
454
455
  entry.instance.setLogLevel(level);
455
456
  }
@@ -489,13 +490,13 @@ export class ServiceManager extends EventEmitter {
489
490
  // Private methods
490
491
 
491
492
  /**
492
- * Setup logging configuration based on environment
493
+ * Setup logging configuration based on config.dev
493
494
  *
494
495
  * @private
495
496
  */
496
497
  _setupLogging() {
497
- // Set default log levels based on environment
498
- if (this.config.environment === 'development') {
498
+ // Set default log levels based on config.debug flag
499
+ if (this.config.debug) {
499
500
  this.config.logConfig.defaultLevel = DEBUG;
500
501
  } else {
501
502
  this.config.logConfig.defaultLevel = WARN;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-sveltekit",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"