chore(logging): add informational logs for SceneMgr and Scene initialization
This commit is contained in:
@@ -16,6 +16,8 @@ const tm = new TimerMgr();
|
|||||||
class SceneMgr {
|
class SceneMgr {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
log.info('Initialization of SceneMgr');
|
||||||
|
|
||||||
this.scenes = this.getScenes().reduce((accumulator, scene) => {
|
this.scenes = this.getScenes().reduce((accumulator, scene) => {
|
||||||
const sceneUID = scene.getUID();
|
const sceneUID = scene.getUID();
|
||||||
accumulator[sceneUID] = new Scene(scene);
|
accumulator[sceneUID] = new Scene(scene);
|
||||||
@@ -70,6 +72,8 @@ class Scene {
|
|||||||
this.sceneSwitchItemName = ITEMPREFIX + "_" + this.sceneUID;
|
this.sceneSwitchItemName = ITEMPREFIX + "_" + this.sceneUID;
|
||||||
this.evaluationRuleUID = "SceneItems" + this.sceneUID;
|
this.evaluationRuleUID = "SceneItems" + this.sceneUID;
|
||||||
|
|
||||||
|
log.info(`Initialize scene ${this.sceneName}`);
|
||||||
|
|
||||||
if (!items[this.sceneSwitchItemName]) {
|
if (!items[this.sceneSwitchItemName]) {
|
||||||
this.createSceneSwitchItem();
|
this.createSceneSwitchItem();
|
||||||
}
|
}
|
||||||
@@ -254,7 +258,7 @@ const sm = new SceneMgr();
|
|||||||
|
|
||||||
// Unload script
|
// Unload script
|
||||||
require('@runtime').lifecycleTracker.addDisposeHook(() => {
|
require('@runtime').lifecycleTracker.addDisposeHook(() => {
|
||||||
log.info('Deinitialization of SceneMgr.js');
|
log.info('Deinitialization of SceneMgr');
|
||||||
|
|
||||||
sm.purgeUnusedSceneSwitchItems();
|
sm.purgeUnusedSceneSwitchItems();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user