Skip to content

Commit

Permalink
fix: Include user name in member creation log
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea committed Oct 10, 2023
1 parent a41b18a commit f5aa959
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/member.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ describe('member', () => {
const result = await createMember(ORG_NAME, memberData, serviceOptions);

expect(result.didSucceed).toBeTrue();
expect(mockLogging.logs).toContainEqual(
partialPinoLog('info', 'Member created', { userName: name }),
);
});

test('Missing name should be set to null', async () => {
Expand Down
5 changes: 4 additions & 1 deletion src/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ export async function createMember(
throw err as Error;
}

options.logger.info({ orgName, memberId: member.id }, 'Member created');
options.logger.info(
{ orgName, userName: memberData.name, memberId: member.id },
'Member created',
);
return {
didSucceed: true,
result: { id: member.id },
Expand Down

0 comments on commit f5aa959

Please sign in to comment.