Replace Logger with getLogger and update next version
This commit replaces the use of Logger with getLogger in various parts of the code to handle logging. The Logger has been replaced with getLogger, which assists in getting logs in an asynchronous manner. In addition to this, it updates the next version in pnpm-lock.yaml from next@14.2.0-canary.61 to next@14.2.0-canary.62 and various other dependencies. Also made minor annotations and comments to the function 'isBrowser' and 'formatCurrency' in the 'utils.ts' file.
This commit is contained in:
@@ -3,7 +3,7 @@ import { SupabaseClient } from '@supabase/supabase-js';
|
||||
import 'server-only';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { Logger } from '@kit/shared/logger';
|
||||
import { getLogger } from '@kit/shared/logger';
|
||||
import { Database } from '@kit/supabase/database';
|
||||
|
||||
const Schema = z.object({
|
||||
@@ -17,12 +17,14 @@ export class LeaveTeamAccountService {
|
||||
constructor(private readonly adminClient: SupabaseClient<Database>) {}
|
||||
|
||||
async leaveTeamAccount(params: z.infer<typeof Schema>) {
|
||||
const logger = await getLogger();
|
||||
|
||||
const ctx = {
|
||||
...params,
|
||||
name: this.namespace,
|
||||
};
|
||||
|
||||
Logger.info(ctx, 'Leaving team account');
|
||||
logger.info(ctx, 'Leaving team account...');
|
||||
|
||||
const { accountId, userId } = Schema.parse(params);
|
||||
|
||||
@@ -35,11 +37,11 @@ export class LeaveTeamAccountService {
|
||||
});
|
||||
|
||||
if (error) {
|
||||
Logger.error({ ...ctx, error }, 'Failed to leave team account');
|
||||
logger.error({ ...ctx, error }, 'Failed to leave team account');
|
||||
|
||||
throw new Error('Failed to leave team account');
|
||||
}
|
||||
|
||||
Logger.info(ctx, 'Successfully left team account');
|
||||
logger.info(ctx, 'Successfully left team account');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user