Moved loggers out of global module scope.

This commit is contained in:
Michael Mainguy 2024-04-28 09:11:19 -05:00
parent 2f29b0a2de
commit e27a77d674
3 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,6 @@ import log from "loglevel";
export function beforeRenderObserver() { export function beforeRenderObserver() {
const logger = log.getLogger('beforeRenderObserver');
if (this?.grabbedMesh?.physicsBody) { if (this?.grabbedMesh?.physicsBody) {
const scene = DefaultScene.Scene; const scene = DefaultScene.Scene;
const hk = (scene.getPhysicsEngine().getPhysicsPlugin() as HavokPlugin); const hk = (scene.getPhysicsEngine().getPhysicsPlugin() as HavokPlugin);
@ -15,11 +14,11 @@ export function beforeRenderObserver() {
hk.setPhysicsBodyTransformation(this.grabbedMesh.physicsBody, parent); hk.setPhysicsBodyTransformation(this.grabbedMesh.physicsBody, parent);
hk.sync(this.grabbedMesh.physicsBody); hk.sync(this.grabbedMesh.physicsBody);
} else { } else {
logger.error("parent not found for " + this.grabbedMeshParentId); log.getLogger('beforeRenderObserver').error("parent not found for " + this.grabbedMeshParentId);
} }
} else { } else {
logger.warn("no parent id"); log.getLogger('beforeRenderObserver').warn("no parent id");
} }
} }

View File

@ -152,7 +152,8 @@ export class DiagramConnection {
} }
private beforeRender = () => { private beforeRender = () => {
if (this.tick % 5 == 0) { if (this.tick++ % 10 == 0) {
this.logger.trace('recalculating', this.tick);
this.recalculate(); this.recalculate();
this.setPoints(); this.setPoints();
} }

View File

@ -15,7 +15,7 @@ import {Introduction} from "./tutorial/introduction";
const webGpu = false; const webGpu = false;
//log.setLevel('debug', false); log.setLevel('debug', false);
export class VrApp { export class VrApp {
private engine: WebGPUEngine | Engine; private engine: WebGPUEngine | Engine;