@@ -2,12 +2,13 @@ import { S3Client } from "@aws-sdk/client-s3";
22import { DynamoDBClient } from "@aws-sdk/client-dynamodb" ;
33import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb" ;
44import { SQSClient } from "@aws-sdk/client-sqs" ;
5- import pino from "pino" ;
5+ import { Logger } from "pino" ;
66import {
77 DBHealthcheck ,
88 LetterRepository ,
99 MIRepository ,
1010} from "@internal/datastore" ;
11+ import { createLogger } from "@internal/helpers" ;
1112import { EnvVars , envVars } from "./env" ;
1213
1314export type Deps = {
@@ -16,7 +17,7 @@ export type Deps = {
1617 letterRepo : LetterRepository ;
1718 miRepo : MIRepository ;
1819 dbHealthcheck : DBHealthcheck ;
19- logger : pino . Logger ;
20+ logger : Logger ;
2021 env : EnvVars ;
2122} ;
2223
@@ -26,7 +27,7 @@ function createDocumentClient(): DynamoDBDocumentClient {
2627}
2728
2829function createLetterRepository (
29- log : pino . Logger ,
30+ log : Logger ,
3031 environment : EnvVars ,
3132) : LetterRepository {
3233 const config = {
@@ -46,10 +47,7 @@ function createDBHealthcheck(environment: EnvVars): DBHealthcheck {
4647 return new DBHealthcheck ( createDocumentClient ( ) , config ) ;
4748}
4849
49- function createMIRepository (
50- log : pino . Logger ,
51- environment : EnvVars ,
52- ) : MIRepository {
50+ function createMIRepository ( log : Logger , environment : EnvVars ) : MIRepository {
5351 const config = {
5452 miTableName : environment . MI_TABLE_NAME ,
5553 miTtlHours : environment . MI_TTL_HOURS ,
@@ -59,7 +57,7 @@ function createMIRepository(
5957}
6058
6159export function createDependenciesContainer ( ) : Deps {
62- const log = pino ( ) ;
60+ const log = createLogger ( { logLevel : envVars . PINO_LOG_LEVEL } ) ;
6361
6462 return {
6563 s3Client : new S3Client ( ) ,
0 commit comments