ninghao-nestjs/src/core/interceptors/logging.interceptor.ts

12 lines
357 B
TypeScript

import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
import { Observable } from 'rxjs';
@Injectable()
export class LoggingInterceptor implements NestInterceptor {
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
console.log('I am a interceptor!')
return next.handle();
}
}