import * as _ from "lodash" ; import { LoggerDiToken } from "./logger.di" ; import { LoggerService } from "./logger.service" ; import { ConfigDiToken , Config , Env } from "../config" ; export const loggerProviders = [ { provide : LoggerDiToken . LOGGER , useFactory : async ( config ) => { const opts = _ . assign ( { } , config . env === Env . PRODUCTION ? { } : { prettyPrint : { translateTime : true , } , } ) ; return new LoggerService ( opts ) ; } , inject : [ ConfigDiToken . CONFIG ] , } , ] ;