From 9bfeb71ce46632ee598d7f39d72b1b962b104dfc Mon Sep 17 00:00:00 2001 From: Sebastian Leidig Date: Tue, 5 Mar 2024 11:30:39 +0100 Subject: [PATCH] fix(logging): don't log display_entity not finding record --- .../entity/display-entity/display-entity.component.spec.ts | 4 ++-- .../entity/display-entity/display-entity.component.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/core/basic-datatypes/entity/display-entity/display-entity.component.spec.ts b/src/app/core/basic-datatypes/entity/display-entity/display-entity.component.spec.ts index 4f88aa80c9..e3380c60d9 100644 --- a/src/app/core/basic-datatypes/entity/display-entity/display-entity.component.spec.ts +++ b/src/app/core/basic-datatypes/entity/display-entity/display-entity.component.spec.ts @@ -84,14 +84,14 @@ describe("DisplayEntityComponent", () => { }); it("should log a warning if entity cannot be loaded", async () => { - const warnSpy = spyOn(TestBed.inject(LoggingService), "warn"); + const logSpy = spyOn(TestBed.inject(LoggingService), "debug"); const child = new Child("not_existing"); component.entityId = child.getId(); component.config = School.ENTITY_TYPE; await component.ngOnInit(); - expect(warnSpy).toHaveBeenCalledWith( + expect(logSpy).toHaveBeenCalledWith( jasmine.stringContaining(child.getId()), ); expect(component.entityToDisplay).toBeUndefined(); diff --git a/src/app/core/basic-datatypes/entity/display-entity/display-entity.component.ts b/src/app/core/basic-datatypes/entity/display-entity/display-entity.component.ts index 4c05efd7d2..fdfa7d26f0 100644 --- a/src/app/core/basic-datatypes/entity/display-entity/display-entity.component.ts +++ b/src/app/core/basic-datatypes/entity/display-entity/display-entity.component.ts @@ -59,7 +59,8 @@ export class DisplayEntityComponent this.entityId, ); } catch (e) { - this.logger.warn( + // this may be caused by restrictive permissions and therefore shouldn't be treated as a technical issue + this.logger.debug( `[DISPLAY_ENTITY] Could not find entity with ID: ${this.entityId}: ${e}`, ); }