3
3
HttpStatus ,
4
4
NotFoundException ,
5
5
BadRequestException ,
6
+ Logger ,
6
7
} from '@nestjs/common' ;
7
8
8
9
import { PrismaPromise } from '@prisma/client' ;
@@ -21,6 +22,8 @@ import { WinningUpdateRequestDto } from './dto/winnings.dto';
21
22
*/
22
23
@Injectable ( )
23
24
export class AdminService {
25
+ private readonly logger = new Logger ( AdminService . name ) ;
26
+
24
27
/**
25
28
* Constructs the admin winning service with the given dependencies.
26
29
* @param prisma the prisma service.
@@ -279,7 +282,7 @@ export class AdminService {
279
282
) {
280
283
throw error ;
281
284
}
282
- console . error ( 'Updating winnings failed' , error ) ;
285
+ this . logger . error ( 'Updating winnings failed' , error ) ;
283
286
const message = 'Updating winnings failed. ' + error ;
284
287
result . error = {
285
288
code : HttpStatus . INTERNAL_SERVER_ERROR ,
@@ -477,7 +480,7 @@ export class AdminService {
477
480
createdAt : item . created_at ,
478
481
} ) ) ;
479
482
} catch ( error ) {
480
- console . error ( 'Getting winnings audit failed' , error ) ;
483
+ this . logger . error ( 'Getting winnings audit failed' , error ) ;
481
484
const message = 'Searching winnings failed. ' + error ;
482
485
result . error = {
483
486
code : HttpStatus . INTERNAL_SERVER_ERROR ,
@@ -536,7 +539,7 @@ export class AdminService {
536
539
externalTransactionDetails : { } ,
537
540
} ) ) ;
538
541
} catch ( error ) {
539
- console . error ( 'Getting winnings audit failed' , error ) ;
542
+ this . logger . error ( 'Getting winnings audit failed' , error ) ;
540
543
const message = 'Searching winnings failed. ' + error ;
541
544
result . error = {
542
545
code : HttpStatus . INTERNAL_SERVER_ERROR ,
0 commit comments