diff --git a/bun.lockb b/bun.lockb index 78cc6c3cb..70c699479 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/authz/src/space-member/space-member.service.ts b/packages/authz/src/space-member/space-member.service.ts index 050cac7b6..80407ec0a 100644 --- a/packages/authz/src/space-member/space-member.service.ts +++ b/packages/authz/src/space-member/space-member.service.ts @@ -1,5 +1,6 @@ import { inject, singleton } from "@undb/di" import { and, None, Option } from "@undb/domain" +import { createLogger } from "@undb/logger" import { injectSpaceService, type ISpaceId, type ISpaceService } from "@undb/space" import type { SetContextValue } from "../../../context/src/context.type" import { MemberIdVO } from "../member/member-id.vo" @@ -32,6 +33,7 @@ export const injectSpaceMemberService = () => inject(SPACE_MEMBER_SERVICE) @singleton() export class SpaceMemberService implements ISpaceMemberService { + private logger = createLogger("SpaceMemberService") constructor( @injectSpaceService() private readonly spaceService: ISpaceService, @@ -110,6 +112,8 @@ export class SpaceMemberService implements ISpaceMemberService { spaceId: ISpaceId, userId: string, ): Promise> { + this.logger.debug({ spaceId, userId }, "setSpaceMemberContext") + if (!spaceId || !userId) { return None } diff --git a/packages/space/package.json b/packages/space/package.json index 21dbc80e5..f61fbdee2 100644 --- a/packages/space/package.json +++ b/packages/space/package.json @@ -5,6 +5,7 @@ "types": "src/index.d.ts", "dependencies": { "@undb/context": "workspace:*", + "@undb/logger": "workspace:*", "ts-pattern": "^5.5.0" }, "devDependencies": { diff --git a/packages/space/src/space.service.ts b/packages/space/src/space.service.ts index 6a9d1f106..df0e9a456 100644 --- a/packages/space/src/space.service.ts +++ b/packages/space/src/space.service.ts @@ -1,5 +1,6 @@ import type { SetContextValue } from "@undb/context" import { inject, singleton } from "@undb/di" +import { createLogger } from "@undb/logger" import { None, Option, Some } from "oxide.ts" import { match, P } from "ts-pattern" import type { ICreateSpaceDTO, ISpaceDTO } from "./dto" @@ -37,6 +38,7 @@ export const injectSpaceService = () => inject(SPACE_SERVICE) @singleton() export class SpaceService implements ISpaceService { + private logger = createLogger("SpaceService") constructor( @injectSpaceRepository() private readonly spaceRepository: ISpaceRepository, @@ -86,6 +88,7 @@ export class SpaceService implements ISpaceService { } async setSpaceContext(setContext: SetContextValue, input: IGetSpaceInput): Promise { + this.logger.debug(input, "setSpaceContext") const space = await this.getSpace(input) setContext("spaceId", space.unwrap().id.value)