Edit timeFromName to fix extrating time format logic from logfile name #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
timeFromName에서 timeformat을 제대로 Parsing하지 못하는 현상 수정
timeFromName 함수로 prefix가 전달 될 때 아래와 같은 2가지 형식으로 전달됨 (해당 로직은 비동기로 실행 됨)
기존 로직에서는 additional log level이 info면 APP-CXRT-info- 로 전달되어서, APP-CXRT-debug- 로 시작되는 file은 삭제가 안됨
prefix로
APP-CXRT-
가 넘어올 때APP-CXRT-2024-01-02.log
와 같은 로그 파일의 날짜만 parsing이 되고APP-CXRT-info-2024-01-02.log
와 같은 파일 명은 날짜를 뽑아내는 로직에서info-2024-01-02
로 뽑히기 때문에 parsing이 안됨 -> parsing이 안되면 삭제 대상이 되는 slice에 추가가 안된다.prefix로
APP-CXRT-info-
가 넘어올 때APP-CXRT-info-2024-01-02.log
와 같은 파일명 에서 날짜를 뽑아내어 삭제 대상이 되는 slice에 추가가 되고 -> additional log 파일이 삭제가 됨추가한 로직은 prefix로
APP-CXRT-
가 넘어올 때 additional log file의 경우info-2024-01-02
이런 식으로 날짜가 뽑히는 경우에만 골라서 제대로 날짜를 parsing할 수 있도록 통과 시켜서 삭제 대상이 되는 slice에 파일을 모두 추가하게끔 처리한다.