@slickteam/nestjs-utils
Version:
Utils functions and classes for Nestjs
15 lines (14 loc) • 709 B
TypeScript
import { HttpStatus, LogLevel, Logger } from '@nestjs/common';
interface LoggerParamsOptions {
level?: LogLevel;
paramNames?: string[];
}
declare function LoggerParams(options?: LogLevel | LoggerParamsOptions): (target: {
constructor: {
name: string;
};
}, propertyKey: string, descriptor: PropertyDescriptor) => void;
declare function throwErrorAndLog(message: any, typeError: HttpStatus | undefined, logger: Logger | undefined): never;
declare function throwErrorAndLogWithContext(message: any, typeError?: HttpStatus, context?: string): never;
declare function logLevel(level: LogLevel): LogLevel[];
export { LoggerParams, throwErrorAndLog, throwErrorAndLogWithContext, logLevel };