@iamnnort/nestjs-logger 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _=Object.defineProperty;var c=(r,e)=>_(r,"name",{value:e,configurable:!0});var _common = require('@nestjs/common');var _core = require('@nestjs/core');var _nestjspino = require('nestjs-pino');var{ConfigurableModuleClass:E,MODULE_OPTIONS_TOKEN:D,OPTIONS_TYPE:H,ASYNC_OPTIONS_TYPE:Y}=new (0, _common.ConfigurableModuleBuilder)().build();function T(r,e,t,n){var s=arguments.length,o=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(i=r[a])&&(o=(s<3?i(o):s>3?i(e,t,o):i(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(T,"_ts_decorate");var f=class{static{c(this,"LoggerExceptionFilter")}catch(e,t){let s=t.switchToHttp().getResponse();if(e instanceof _common.HttpException){let o=e.getStatus(),i=e.getResponse();return s.status(o).json(i)}s.status(_common.HttpStatus.INTERNAL_SERVER_ERROR).json({message:"Something went wrong.",error:"Internal Server Error",statusCode:_common.HttpStatus.INTERNAL_SERVER_ERROR})}};f=T([_common.Catch.call(void 0, )],f);function m(r){return{pinoHttp:{level:r.level,timestamp:!1,transport:{target:"pino-pretty",options:{colorize:!1,ignore:"pid,hostname,req,res,responseTime,reqId",messageFormat:"{msg}"}},customSuccessMessage:h,customErrorMessage:A,customAttributeKeys:{err:"error"}},forRoutes:[{path:"*",method:_common.RequestMethod.ALL}]}}c(m,"makePinoParams");function h(r,e,t){return`[Http] ${r.method} ${r.url} ${e.statusCode} (${t}ms)`}c(h,"makeSuccessMessage");function A(r,e){return`[Http] ${r.method} ${r.url} ${e.statusCode}`}c(A,"makeErrorMessage");var l=(function(r){return r.SYSTEM="System",r.INSTANCE_LOADER="InstanceLoader",r.ROUTES_RESOLVER="RoutesResolver",r.ROUTER_EXPLORER="RouterExplorer",r.NEST_FACTORY="NestFactory",r.NEST_APPLICATION="NestApplication",r})({});function d(r,e,t,n){var s=arguments.length,o=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(i=r[a])&&(o=(s<3?i(o):s>3?i(e,t,o):i(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(d,"_ts_decorate");function I(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}c(I,"_ts_metadata");var p=class extends _common.ConsoleLogger{static{c(this,"LoggerService")}print(e,t,n){let s=_optionalChain([n, 'optionalAccess', _2 => _2.replace, 'call', _3 => _3(/^_/,"")])||this.context||"";if([l.INSTANCE_LOADER,l.ROUTES_RESOLVER,l.ROUTER_EXPLORER].includes(s))return;let a={[l.NEST_FACTORY]:"Application is starting...",[l.NEST_APPLICATION]:"Application started."}[s]||t||"";return this.logger[e](`[${s}] ${a}`)}log(e,t){this.print("log",e,t)}error(e,t){this.print("error",e,t)}warn(e,t){this.print("warn",e,t)}debug(e,t){this.print("debug",e,t)}verbose(e,t){this.print("verbose",e,t)}fatal(e,t){this.print("fatal",e,t)}};d([_common.Inject.call(void 0, _nestjspino.Logger),I("design:type",typeof _nestjspino.Logger>"u"?Object:_nestjspino.Logger)],p.prototype,"logger",void 0);p= exports.LoggerService =d([_common.Injectable.call(void 0, {scope:_common.Scope.TRANSIENT})],p);function y(r,e,t,n){var s=arguments.length,o=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(i=r[a])&&(o=(s<3?i(o):s>3?i(e,t,o):i(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(y,"_ts_decorate");var u=class extends E{static{c(this,"LoggerModule")}static register(e){let t=super.register(e);return{...t,imports:[..._nullishCoalesce(t.imports, () => ([])),_nestjspino.LoggerModule.forRoot(m(e))]}}static registerAsync(e){let t=super.registerAsync(e);return{...t,imports:[..._nullishCoalesce(t.imports, () => ([])),_nestjspino.LoggerModule.forRootAsync({imports:e.imports,inject:e.inject,useFactory:c(async(...n)=>{if(e.useFactory){let s=await e.useFactory(...n);return m(s)}return m({})},"useFactory")})]}}};u= exports.LoggerModule =y([_common.Global.call(void 0, ),_common.Module.call(void 0, {providers:[p,{provide:_core.APP_FILTER,useClass:f}],exports:[p]})],u);exports.LoggerModule = u; exports.LoggerService = p;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/nestjs-logger/nestjs-logger/dist/index.js","../src/module.ts","../src/module-definition.ts","../src/exception-filter.ts","../src/
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/nestjs-logger/nestjs-logger/dist/index.js","../src/module.ts","../src/module-definition.ts","../src/exception-filter.ts","../src/builder.ts"],"names":["ConfigurableModuleClass","MODULE_OPTIONS_TOKEN","OPTIONS_TYPE","ASYNC_OPTIONS_TYPE","ConfigurableModuleBuilder","build","LoggerExceptionFilter","catch","exception","host","response","switchToHttp","getResponse","HttpException","statusCode","getStatus","errorResponse","status","json","HttpStatus","INTERNAL_SERVER_ERROR","message","error","makePinoParams","options","pinoHttp","level","timestamp","transport","target","colorize","ignore","messageFormat","customSuccessMessage","makeSuccessMessage","customErrorMessage","makeErrorMessage","customAttributeKeys","err","forRoutes","path","method","RequestMethod","ALL","req","res","responseTime","url"],"mappings":"AAAA,qrBAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CCA9E,wCAA8C,oCACnB,yCAC4B,GCC1C,CAAEA,uBAAAA,CAAAA,CAAAA,CAAyBC,oBAAAA,CAAAA,CAAAA,CAAsBC,YAAAA,CAAAA,CAAAA,CAAcC,kBAAAA,CAAAA,CAAkB,CAAA,CAC5F,IAAIC,sCAAAA,CAAAA,CAAAA,CAA0CC,KAAAA,CAAK,CAAA,CCJrD,SAA2F,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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G,CAAAA,CAAIG,GAAG,CAAA,CAAA,EAAIF,CAAAA,CAAI/B,UAAU,CAAA,EAAA,EAAKgC,CAAAA,CAAAA,GAAAA,CAC/D,CAFSZ,CAAAA,CAAAA,CAAAA,CAAAA,oBAAAA,CAAAA,CAIT,SAASE,CAAAA,CAAiBQ,CAAAA,CAAsBC,CAAAA,CAAmB,CACjE,MAAO,CAAA,OAAA,EAAUD,CAAAA,CAAIH,MAAM,CAAA,CAAA,EAAIG,CAAAA,CAAIG,GAAG,CAAA,CAAA,EAAIF,CAAAA,CAAI/B,UAAU,CAAA,CAAA","file":"/home/runner/work/nestjs-logger/nestjs-logger/dist/index.js","sourcesContent":[null,"import { DynamicModule, Global, Module } from '@nestjs/common';\nimport { APP_FILTER } from '@nestjs/core';\nimport { LoggerModule as NestJsPinoLoggerModule } from 'nestjs-pino';\nimport { ASYNC_OPTIONS_TYPE, ConfigurableModuleClass, OPTIONS_TYPE } from './module-definition';\nimport { LoggerExceptionFilter } from './exception-filter';\nimport { makePinoParams } from './builder';\nimport { LoggerService } from './service';\nimport type { LoggerConfig } from './types';\n\n@Global()\n@Module({\n providers: [LoggerService, { provide: APP_FILTER, useClass: LoggerExceptionFilter }],\n exports: [LoggerService],\n})\nexport class LoggerModule extends ConfigurableModuleClass {\n static register(options: typeof OPTIONS_TYPE): DynamicModule {\n const base = super.register(options);\n\n return {\n ...base,\n imports: [...(base.imports ?? []), NestJsPinoLoggerModule.forRoot(makePinoParams(options))],\n };\n }\n\n static registerAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule {\n const base = super.registerAsync(options);\n\n return {\n ...base,\n imports: [\n ...(base.imports ?? []),\n NestJsPinoLoggerModule.forRootAsync({\n imports: options.imports,\n inject: options.inject,\n useFactory: async (...args: unknown[]) => {\n if (options.useFactory) {\n const config = await options.useFactory(...args);\n\n return makePinoParams(config);\n }\n\n return makePinoParams({} as LoggerConfig);\n },\n }),\n ],\n };\n }\n}\n","import { ConfigurableModuleBuilder } from '@nestjs/common';\nimport { LoggerConfig } from './types';\n\nexport const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE, ASYNC_OPTIONS_TYPE } =\n new ConfigurableModuleBuilder<LoggerConfig>().build();\n","import { type ArgumentsHost, Catch, type ExceptionFilter, HttpException, HttpStatus } from '@nestjs/common';\nimport type { Response } from 'express';\n\n@Catch()\nexport class LoggerExceptionFilter implements ExceptionFilter {\n catch(exception: unknown, host: ArgumentsHost) {\n const ctx = host.switchToHttp();\n const response = ctx.getResponse<Response>();\n\n if (exception instanceof HttpException) {\n const statusCode = exception.getStatus();\n const errorResponse = exception.getResponse();\n\n return response.status(statusCode).json(errorResponse);\n }\n\n response.status(HttpStatus.INTERNAL_SERVER_ERROR).json({\n message: 'Something went wrong.',\n error: 'Internal Server Error',\n statusCode: HttpStatus.INTERNAL_SERVER_ERROR,\n });\n }\n}\n","import type { IncomingMessage, ServerResponse } from 'http';\nimport type { Params as NestJsPinoParams } from 'nestjs-pino';\nimport { OPTIONS_TYPE } from './module-definition';\nimport { RequestMethod } from '@nestjs/common';\n\nexport function makePinoParams(options: typeof OPTIONS_TYPE): NestJsPinoParams {\n return {\n pinoHttp: {\n level: options.level,\n timestamp: false,\n transport: {\n target: 'pino-pretty',\n options: {\n colorize: false,\n ignore: 'pid,hostname,req,res,responseTime,reqId',\n messageFormat: '{msg}',\n },\n },\n customSuccessMessage: makeSuccessMessage,\n customErrorMessage: makeErrorMessage,\n customAttributeKeys: {\n err: 'error',\n },\n },\n forRoutes: [\n {\n path: '*',\n method: RequestMethod.ALL,\n },\n ],\n };\n}\n\nfunction makeSuccessMessage(req: IncomingMessage, res: ServerResponse, responseTime: number): string {\n return `[Http] ${req.method} ${req.url} ${res.statusCode} (${responseTime}ms)`;\n}\n\nfunction makeErrorMessage(req: IncomingMessage, res: ServerResponse): string {\n return `[Http] ${req.method} ${req.url} ${res.statusCode}`;\n}\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _=Object.defineProperty;var c=(r,e)=>_(r,"name",{value:e,configurable:!0});import{Global as x,Module as C}from"@nestjs/common";import{APP_FILTER as w}from"@nestjs/core";import{LoggerModule as O}from"nestjs-pino";import{ConfigurableModuleBuilder as S}from"@nestjs/common";var{ConfigurableModuleClass:E,MODULE_OPTIONS_TOKEN:D,OPTIONS_TYPE:H,ASYNC_OPTIONS_TYPE:Y}=new S().build();import{Catch as N,HttpException as P,HttpStatus as g}from"@nestjs/common";function T(r,e,t,n){var s=arguments.length,o=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(i=r[a])&&(o=(s<3?i(o):s>3?i(e,t,o):i(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(T,"_ts_decorate");var f=class{static{c(this,"LoggerExceptionFilter")}catch(e,t){let s=t.switchToHttp().getResponse();if(e instanceof P){let o=e.getStatus(),i=e.getResponse();return s.status(o).json(i)}s.status(g.INTERNAL_SERVER_ERROR).json({message:"Something went wrong.",error:"Internal Server Error",statusCode:g.INTERNAL_SERVER_ERROR})}};f=T([N()],f);import{RequestMethod as b}from"@nestjs/common";function m(r){return{pinoHttp:{level:r.level,timestamp:!1,transport:{target:"pino-pretty",options:{colorize:!1,ignore:"pid,hostname,req,res,responseTime,reqId",messageFormat:"{msg}"}},customSuccessMessage:h,customErrorMessage:A,customAttributeKeys:{err:"error"}},forRoutes:[{path:"*",method:b.ALL}]}}c(m,"makePinoParams");function h(r,e,t){return`[Http] ${r.method} ${r.url} ${e.statusCode} (${t}ms)`}c(h,"makeSuccessMessage");function A(r,e){return`[Http] ${r.method} ${r.url} ${e.statusCode}`}c(A,"makeErrorMessage");import{ConsoleLogger as j,Inject as v,Injectable as L,Scope as M}from"@nestjs/common";import{Logger as R}from"nestjs-pino";var l=(function(r){return r.SYSTEM="System",r.INSTANCE_LOADER="InstanceLoader",r.ROUTES_RESOLVER="RoutesResolver",r.ROUTER_EXPLORER="RouterExplorer",r.NEST_FACTORY="NestFactory",r.NEST_APPLICATION="NestApplication",r})({});function d(r,e,t,n){var s=arguments.length,o=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(i=r[a])&&(o=(s<3?i(o):s>3?i(e,t,o):i(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(d,"_ts_decorate");function I(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}c(I,"_ts_metadata");var p=class extends j{static{c(this,"LoggerService")}logger;print(e,t,n){let s=n?.replace(/^_/,"")||this.context||"";if([l.INSTANCE_LOADER,l.ROUTES_RESOLVER,l.ROUTER_EXPLORER].includes(s))return;let a={[l.NEST_FACTORY]:"Application is starting...",[l.NEST_APPLICATION]:"Application started."}[s]||t||"";return this.logger[e](`[${s}] ${a}`)}log(e,t){this.print("log",e,t)}error(e,t){this.print("error",e,t)}warn(e,t){this.print("warn",e,t)}debug(e,t){this.print("debug",e,t)}verbose(e,t){this.print("verbose",e,t)}fatal(e,t){this.print("fatal",e,t)}};d([v(R),I("design:type",typeof R>"u"?Object:R)],p.prototype,"logger",void 0);p=d([L({scope:M.TRANSIENT})],p);function y(r,e,t,n){var s=arguments.length,o=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(i=r[a])&&(o=(s<3?i(o):s>3?i(e,t,o):i(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}c(y,"_ts_decorate");var u=class extends E{static{c(this,"LoggerModule")}static register(e){let t=super.register(e);return{...t,imports:[...t.imports??[],O.forRoot(m(e))]}}static registerAsync(e){let t=super.registerAsync(e);return{...t,imports:[...t.imports??[],O.forRootAsync({imports:e.imports,inject:e.inject,useFactory:c(async(...n)=>{if(e.useFactory){let s=await e.useFactory(...n);return m(s)}return m({})},"useFactory")})]}}};u=y([x(),C({providers:[p,{provide:w,useClass:f}],exports:[p]})],u);export{u as LoggerModule,p as LoggerService};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/module.ts","../src/module-definition.ts","../src/exception-filter.ts","../src/message.ts","../src/service.ts","../src/types.ts"],"sourcesContent":["import { DynamicModule, Global, Module, RequestMethod } from '@nestjs/common';\nimport { APP_FILTER } from '@nestjs/core';\nimport { LoggerModule as NestJsPinoLoggerModule } from 'nestjs-pino';\nimport { ASYNC_OPTIONS_TYPE, ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE } from './module-definition';\nimport { LoggerExceptionFilter } from './exception-filter';\nimport { buildSuccessMessage, buildErrorMessage } from './message';\nimport { LoggerService } from './service';\nimport type { LoggerConfig } from './types';\n\nfunction buildPinoParams(options: typeof OPTIONS_TYPE) {\n return {\n pinoHttp: {\n level: options.level ?? 'info',\n timestamp: false,\n transport: {\n target: 'pino-pretty',\n options: {\n colorize: false,\n ignore: 'pid,hostname,req,res,responseTime,reqId',\n messageFormat: '{msg}',\n },\n },\n customSuccessMessage: buildSuccessMessage,\n customErrorMessage: buildErrorMessage,\n customAttributeKeys: {\n err: 'error',\n },\n },\n forRoutes: [\n {\n path: '*',\n method: RequestMethod.ALL,\n },\n ],\n };\n}\n\n@Global()\n@Module({\n providers: [LoggerService, { provide: APP_FILTER, useClass: LoggerExceptionFilter }],\n exports: [LoggerService],\n})\nexport class LoggerModule extends ConfigurableModuleClass {\n static register(options: typeof OPTIONS_TYPE): DynamicModule {\n const base = super.register(options);\n\n return {\n ...base,\n imports: [...(base.imports ?? []), NestJsPinoLoggerModule.forRoot(buildPinoParams(options))],\n };\n }\n\n static registerAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule {\n const base = super.registerAsync(options);\n\n return {\n ...base,\n imports: [\n ...(base.imports ?? []),\n NestJsPinoLoggerModule.forRootAsync({\n imports: options.imports,\n inject: [MODULE_OPTIONS_TOKEN],\n useFactory: (config: LoggerConfig) => buildPinoParams(config),\n }),\n ],\n };\n }\n}\n","import { ConfigurableModuleBuilder } from '@nestjs/common';\nimport { LoggerConfig } from './types';\n\nexport const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE, ASYNC_OPTIONS_TYPE } =\n new ConfigurableModuleBuilder<LoggerConfig>().build();\n","import { type ArgumentsHost, Catch, type ExceptionFilter, HttpException, HttpStatus } from '@nestjs/common';\nimport type { Response } from 'express';\n\n@Catch()\nexport class LoggerExceptionFilter implements ExceptionFilter {\n catch(exception: unknown, host: ArgumentsHost) {\n const ctx = host.switchToHttp();\n const response = ctx.getResponse<Response>();\n\n if (exception instanceof HttpException) {\n const statusCode = exception.getStatus();\n const errorResponse = exception.getResponse();\n\n return response.status(statusCode).json(errorResponse);\n }\n\n response.status(HttpStatus.INTERNAL_SERVER_ERROR).json({\n message: 'Something went wrong.',\n error: 'Internal Server Error',\n statusCode: HttpStatus.INTERNAL_SERVER_ERROR,\n });\n }\n}\n","import type { IncomingMessage, ServerResponse } from 'http';\n\nexport function buildSuccessMessage(req: IncomingMessage, res: ServerResponse, responseTime: number): string {\n return `[Http] ${req.method} ${req.url} ${res.statusCode} (${responseTime}ms)`;\n}\n\nexport function buildErrorMessage(req: IncomingMessage, res: ServerResponse): string {\n return `[Http] ${req.method} ${req.url} ${res.statusCode}`;\n}\n","import { ConsoleLogger, Inject, Injectable, Scope } from '@nestjs/common';\nimport { Logger as PinoNestLogger } from 'nestjs-pino';\nimport { LoggerContexts } from './types';\n\n@Injectable({\n scope: Scope.TRANSIENT,\n})\nexport class LoggerService extends ConsoleLogger {\n @Inject(PinoNestLogger)\n private readonly logger: PinoNestLogger;\n\n private print(fnName: string, message: any, context?: string) {\n const ctx = context?.replace(/^_/, '') || this.context || '';\n\n const ctxBlacklist: string[] = [\n LoggerContexts.INSTANCE_LOADER,\n LoggerContexts.ROUTES_RESOLVER,\n LoggerContexts.ROUTER_EXPLORER,\n ];\n\n if (ctxBlacklist.includes(ctx)) {\n return;\n }\n\n const ctxMessageMap: Record<string, string> = {\n [LoggerContexts.NEST_FACTORY]: 'Application is starting...',\n [LoggerContexts.NEST_APPLICATION]: 'Application started.',\n };\n\n const msg = ctxMessageMap[ctx] || message || '';\n\n return this.logger[fnName](`[${ctx}] ${msg}`);\n }\n\n log(message: any, context?: string) {\n this.print('log', message, context);\n }\n\n error(message: any, context?: string) {\n this.print('error', message, context);\n }\n\n warn(message: any, context?: string) {\n this.print('warn', message, context);\n }\n\n debug(message: any, context?: string) {\n this.print('debug', message, context);\n }\n\n verbose(message: any, context?: string) {\n this.print('verbose', message, context);\n }\n\n fatal(message: any, context?: string) {\n this.print('fatal', message, context);\n }\n}\n","export type LoggerConfig = {\n level: 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace';\n};\n\nexport enum LoggerContexts {\n SYSTEM = 'System',\n INSTANCE_LOADER = 'InstanceLoader',\n ROUTES_RESOLVER = 'RoutesResolver',\n ROUTER_EXPLORER = 'RouterExplorer',\n NEST_FACTORY = 'NestFactory',\n NEST_APPLICATION = 'NestApplication',\n}\n"],"mappings":"+EAAA,OAAwBA,UAAAA,EAAQC,UAAAA,EAAQC,iBAAAA,MAAqB,iBAC7D,OAASC,cAAAA,MAAkB,eAC3B,OAASC,gBAAgBC,MAA8B,cCFvD,OAASC,6BAAAA,MAAiC,iBAGnC,GAAM,CAAEC,wBAAAA,EAAyBC,qBAAAA,EAAsBC,aAAAA,EAAcC,mBAAAA,CAAkB,EAC5F,IAAIJ,EAAAA,EAA0CK,MAAK,ECJrD,OAA6BC,SAAAA,EAA6BC,iBAAAA,EAAeC,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,cAAc3B,CAAAA,EAEjC,MAAO,CACL,GAAGuB,EACHC,QAAS,IACHD,EAAKC,SAAW,CAAA,EACpBC,EAAuBG,aAAa,CAClCJ,QAASxB,EAAQwB,QACjBK,OAAQ,CAACC,GACTC,WAAYC,EAACC,GAAyBlC,EAAgBkC,CAAAA,EAA1C,aACd,CAAA,EAEJ,CACF,CACF,cA5BEC,UAAW,CAACC,EAAe,CAAEC,QAASC,EAAYC,SAAUC,CAAsB,GAClFC,QAAS,CAACL","names":["Global","Module","RequestMethod","APP_FILTER","LoggerModule","NestJsPinoLoggerModule","ConfigurableModuleBuilder","ConfigurableModuleClass","MODULE_OPTIONS_TOKEN","OPTIONS_TYPE","ASYNC_OPTIONS_TYPE","build","Catch","HttpException","HttpStatus","LoggerExceptionFilter","catch","exception","host","response","switchToHttp","getResponse","HttpException","statusCode","getStatus","errorResponse","status","json","HttpStatus","INTERNAL_SERVER_ERROR","message","error","buildSuccessMessage","req","res","responseTime","method","url","statusCode","buildErrorMessage","ConsoleLogger","Inject","Injectable","Scope","Logger","PinoNestLogger","LoggerContexts","LoggerService","ConsoleLogger","logger","print","fnName","message","context","ctx","replace","LoggerContexts","INSTANCE_LOADER","ROUTES_RESOLVER","ROUTER_EXPLORER","includes","msg","NEST_FACTORY","NEST_APPLICATION","log","error","warn","debug","verbose","fatal","scope","Scope","TRANSIENT","buildPinoParams","options","pinoHttp","level","timestamp","transport","target","colorize","ignore","messageFormat","customSuccessMessage","buildSuccessMessage","customErrorMessage","buildErrorMessage","customAttributeKeys","err","forRoutes","path","method","RequestMethod","ALL","LoggerModule","ConfigurableModuleClass","register","base","imports","NestJsPinoLoggerModule","forRoot","registerAsync","forRootAsync","inject","MODULE_OPTIONS_TOKEN","useFactory","__name","config","providers","LoggerService","provide","APP_FILTER","useClass","LoggerExceptionFilter","exports"]}
|
|
1
|
+
{"version":3,"sources":["../src/module.ts","../src/module-definition.ts","../src/exception-filter.ts","../src/builder.ts","../src/service.ts","../src/types.ts"],"sourcesContent":["import { DynamicModule, Global, Module } from '@nestjs/common';\nimport { APP_FILTER } from '@nestjs/core';\nimport { LoggerModule as NestJsPinoLoggerModule } from 'nestjs-pino';\nimport { ASYNC_OPTIONS_TYPE, ConfigurableModuleClass, OPTIONS_TYPE } from './module-definition';\nimport { LoggerExceptionFilter } from './exception-filter';\nimport { makePinoParams } from './builder';\nimport { LoggerService } from './service';\nimport type { LoggerConfig } from './types';\n\n@Global()\n@Module({\n providers: [LoggerService, { provide: APP_FILTER, useClass: LoggerExceptionFilter }],\n exports: [LoggerService],\n})\nexport class LoggerModule extends ConfigurableModuleClass {\n static register(options: typeof OPTIONS_TYPE): DynamicModule {\n const base = super.register(options);\n\n return {\n ...base,\n imports: [...(base.imports ?? []), NestJsPinoLoggerModule.forRoot(makePinoParams(options))],\n };\n }\n\n static registerAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule {\n const base = super.registerAsync(options);\n\n return {\n ...base,\n imports: [\n ...(base.imports ?? []),\n NestJsPinoLoggerModule.forRootAsync({\n imports: options.imports,\n inject: options.inject,\n useFactory: async (...args: unknown[]) => {\n if (options.useFactory) {\n const config = await options.useFactory(...args);\n\n return makePinoParams(config);\n }\n\n return makePinoParams({} as LoggerConfig);\n },\n }),\n ],\n };\n }\n}\n","import { ConfigurableModuleBuilder } from '@nestjs/common';\nimport { LoggerConfig } from './types';\n\nexport const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN, OPTIONS_TYPE, ASYNC_OPTIONS_TYPE } =\n new ConfigurableModuleBuilder<LoggerConfig>().build();\n","import { type ArgumentsHost, Catch, type ExceptionFilter, HttpException, HttpStatus } from '@nestjs/common';\nimport type { Response } from 'express';\n\n@Catch()\nexport class LoggerExceptionFilter implements ExceptionFilter {\n catch(exception: unknown, host: ArgumentsHost) {\n const ctx = host.switchToHttp();\n const response = ctx.getResponse<Response>();\n\n if (exception instanceof HttpException) {\n const statusCode = exception.getStatus();\n const errorResponse = exception.getResponse();\n\n return response.status(statusCode).json(errorResponse);\n }\n\n response.status(HttpStatus.INTERNAL_SERVER_ERROR).json({\n message: 'Something went wrong.',\n error: 'Internal Server Error',\n statusCode: HttpStatus.INTERNAL_SERVER_ERROR,\n });\n }\n}\n","import type { IncomingMessage, ServerResponse } from 'http';\nimport type { Params as NestJsPinoParams } from 'nestjs-pino';\nimport { OPTIONS_TYPE } from './module-definition';\nimport { RequestMethod } from '@nestjs/common';\n\nexport function makePinoParams(options: typeof OPTIONS_TYPE): NestJsPinoParams {\n return {\n pinoHttp: {\n level: options.level,\n timestamp: false,\n transport: {\n target: 'pino-pretty',\n options: {\n colorize: false,\n ignore: 'pid,hostname,req,res,responseTime,reqId',\n messageFormat: '{msg}',\n },\n },\n customSuccessMessage: makeSuccessMessage,\n customErrorMessage: makeErrorMessage,\n customAttributeKeys: {\n err: 'error',\n },\n },\n forRoutes: [\n {\n path: '*',\n method: RequestMethod.ALL,\n },\n ],\n };\n}\n\nfunction makeSuccessMessage(req: IncomingMessage, res: ServerResponse, responseTime: number): string {\n return `[Http] ${req.method} ${req.url} ${res.statusCode} (${responseTime}ms)`;\n}\n\nfunction makeErrorMessage(req: IncomingMessage, res: ServerResponse): string {\n return `[Http] ${req.method} ${req.url} ${res.statusCode}`;\n}\n","import { ConsoleLogger, Inject, Injectable, Scope } from '@nestjs/common';\nimport { Logger as PinoNestLogger } from 'nestjs-pino';\nimport { LoggerContexts } from './types';\n\n@Injectable({\n scope: Scope.TRANSIENT,\n})\nexport class LoggerService extends ConsoleLogger {\n @Inject(PinoNestLogger)\n private readonly logger: PinoNestLogger;\n\n private print(fnName: string, message: any, context?: string) {\n const ctx = context?.replace(/^_/, '') || this.context || '';\n\n const ctxBlacklist: string[] = [\n LoggerContexts.INSTANCE_LOADER,\n LoggerContexts.ROUTES_RESOLVER,\n LoggerContexts.ROUTER_EXPLORER,\n ];\n\n if (ctxBlacklist.includes(ctx)) {\n return;\n }\n\n const ctxMessageMap: Record<string, string> = {\n [LoggerContexts.NEST_FACTORY]: 'Application is starting...',\n [LoggerContexts.NEST_APPLICATION]: 'Application started.',\n };\n\n const msg = ctxMessageMap[ctx] || message || '';\n\n return this.logger[fnName](`[${ctx}] ${msg}`);\n }\n\n log(message: any, context?: string) {\n this.print('log', message, context);\n }\n\n error(message: any, context?: string) {\n this.print('error', message, context);\n }\n\n warn(message: any, context?: string) {\n this.print('warn', message, context);\n }\n\n debug(message: any, context?: string) {\n this.print('debug', message, context);\n }\n\n verbose(message: any, context?: string) {\n this.print('verbose', message, context);\n }\n\n fatal(message: any, context?: string) {\n this.print('fatal', message, context);\n }\n}\n","export type LoggerConfig = {\n level: 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace';\n};\n\nexport enum LoggerContexts {\n SYSTEM = 'System',\n INSTANCE_LOADER = 'InstanceLoader',\n ROUTES_RESOLVER = 'RoutesResolver',\n ROUTER_EXPLORER = 'RouterExplorer',\n NEST_FACTORY = 'NestFactory',\n NEST_APPLICATION = 'NestApplication',\n}\n"],"mappings":"+EAAA,OAAwBA,UAAAA,EAAQC,UAAAA,MAAc,iBAC9C,OAASC,cAAAA,MAAkB,eAC3B,OAASC,gBAAgBC,MAA8B,cCFvD,OAASC,6BAAAA,MAAiC,iBAGnC,GAAM,CAAEC,wBAAAA,EAAyBC,qBAAAA,EAAsBC,aAAAA,EAAcC,mBAAAA,CAAkB,EAC5F,IAAIJ,EAAAA,EAA0CK,MAAK,ECJrD,OAA6BC,SAAAA,EAA6BC,iBAAAA,EAAeC,cAAAA,MAAkB,0WAIpF,IAAMC,EAAN,KAAMA,OAAAA,CAAAA,EAAAA,8BACXC,MAAMC,EAAoBC,EAAqB,CAE7C,IAAMC,EADMD,EAAKE,aAAY,EACRC,YAAW,EAEhC,GAAIJ,aAAqBK,EAAe,CACtC,IAAMC,EAAaN,EAAUO,UAAS,EAChCC,EAAgBR,EAAUI,YAAW,EAE3C,OAAOF,EAASO,OAAOH,CAAAA,EAAYI,KAAKF,CAAAA,CAC1C,CAEAN,EAASO,OA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EA,OAAOP,EAAe,CAAC,CAAA,CACzB,EARY,aASd,CAAA,EAEJ,CACF,CACF,cApCEQ,UAAW,CAACC,EAAe,CAAEC,QAASC,EAAYC,SAAUC,CAAsB,GAClFC,QAAS,CAACL","names":["Global","Module","APP_FILTER","LoggerModule","NestJsPinoLoggerModule","ConfigurableModuleBuilder","ConfigurableModuleClass","MODULE_OPTIONS_TOKEN","OPTIONS_TYPE","ASYNC_OPTIONS_TYPE","build","Catch","HttpException","HttpStatus","LoggerExceptionFilter","catch","exception","host","response","switchToHttp","getResponse","HttpException","statusCode","getStatus","errorResponse","status","json","HttpStatus","INTERNAL_SERVER_ERROR","message","error","RequestMethod","makePinoParams","options","pinoHttp","level","timestamp","transport","target","colorize","ignore","messageFormat","customSuccessMessage","makeSuccessMessage","customErrorMessage","makeErrorMessage","customAttributeKeys","err","forRoutes","path","method","RequestMethod","ALL","req","res","responseTime","url","statusCode","ConsoleLogger","Inject","Injectable","Scope","Logger","PinoNestLogger","LoggerContexts","LoggerService","ConsoleLogger","logger","print","fnName","message","context","ctx","replace","LoggerContexts","INSTANCE_LOADER","ROUTES_RESOLVER","ROUTER_EXPLORER","includes","msg","NEST_FACTORY","NEST_APPLICATION","log","error","warn","debug","verbose","fatal","scope","Scope","TRANSIENT","LoggerModule","ConfigurableModuleClass","register","options","base","imports","NestJsPinoLoggerModule","forRoot","makePinoParams","registerAsync","forRootAsync","inject","useFactory","__name","args","config","providers","LoggerService","provide","APP_FILTER","useClass","LoggerExceptionFilter","exports"]}
|