Skip to content

Commit

Permalink
fix: 로거 날짜 형식 정상화
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Dec 15, 2024
1 parent 1666820 commit e7b5279
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';

Check warning on line 1 in backend/src/SaneLogger.ts

View check run for this annotation

Codecov / codecov/patch

backend/src/SaneLogger.ts#L1

Added line #L1 was not covered by tests

export class SaneLogger extends ConsoleLogger implements LoggerService {
protected override getTimestamp() {
return new Date()

Check warning on line 5 in backend/src/SaneLogger.ts

View check run for this annotation

Codecov / codecov/patch

backend/src/SaneLogger.ts#L3-L5

Added lines #L3 - L5 were not covered by tests
.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';

Check warning on line 5 in backend/src/main.ts

View check run for this annotation

Codecov / codecov/patch

backend/src/main.ts#L5

Added line #L5 was not covered by tests

async function bootstrap() {
const app = await NestFactory.create(AppModule);
const app = await NestFactory.create(AppModule, {

Check warning on line 8 in backend/src/main.ts

View check run for this annotation

Codecov / codecov/patch

backend/src/main.ts#L8

Added line #L8 was not covered by tests
logger: new SaneLogger(),
});

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

0 comments on commit e7b5279

Please sign in to comment.