@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.
@@ -13,7 +13,7 @@
|
|
13
13
|
* import AuthService from './services/AuthService.js';
|
14
14
|
*
|
15
15
|
* const manager = new ServiceManager({
|
16
|
-
*
|
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
|
-
|
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
|
-
|
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
|
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
|
498
|
-
if (this.config.
|
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;
|