Skip to content

Commit

Permalink
fix: 로거 날짜 형식 정상화 (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 authored Dec 22, 2024
1 parent 1666820 commit c035235
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions backend/src/SaneLogger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ConsoleLogger, LoggerService } from '@nestjs/common';

export class SaneLogger extends ConsoleLogger implements LoggerService {
protected override getTimestamp() {
return new Date()
.toISOString()
.replace(/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}).*/g, '$1 $2');
}
}
5 changes: 4 additions & 1 deletion backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { patchNestjsSwagger } from '@anatine/zod-nestjs';
import { SaneLogger } from './SaneLogger';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
const app = await NestFactory.create(AppModule, {
logger: new SaneLogger(),
});

const config = new DocumentBuilder()
.setTitle('집현전 백엔드 6차')
Expand Down

0 comments on commit c035235

Please sign in to comment.