Skip to content

Commit a2b996e

Browse files
committed
feat: enhance keyring creation logging with detailed information
- Added dayjs for date formatting. - Improved console output during keyring creation to include key name, roles, suspended date, and access token.
1 parent d4a3516 commit a2b996e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/api/src/core/keyrings/keyrings.command.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ModuleRef } from '@nestjs/core';
2+
import dayjs from 'dayjs';
23
import { Command, CommandRunner, InquirerService, Question, QuestionSet, SubCommand } from 'nest-commander';
34
import { ApiSession } from '~/_common/data/api-session';
45
import { AuthService } from '~/core/auth/auth.service';
@@ -67,7 +68,11 @@ export class KeyringsCreateCommand extends CommandRunner {
6768
false,
6869
options,
6970
);
70-
console.log('Keyring created successfully', access_token);
71+
console.log('Keyring created successfully !');
72+
console.log('Name: ', key.name);
73+
console.log('Roles: ', key.roles);
74+
console.log('Suspended At: ', key.suspendedAt ? dayjs(key.suspendedAt).format('DD/MM/YYYY HH:mm:ss') : 'Never');
75+
console.log('Token: ', access_token);
7176
} catch (error) {
7277
console.error('Error creating keyring', error);
7378
}

0 commit comments

Comments
 (0)