Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit timeFromName to fix extrating time format logic from logfile name #6

Draft
wants to merge 1 commit into
base: v2.0
Choose a base branch
from

Conversation

zooozoo
Copy link

@zooozoo zooozoo commented Jan 11, 2024

timeFromName에서 timeformat을 제대로 Parsing하지 못하는 현상 수정

timeFromName 함수로 prefix가 전달 될 때 아래와 같은 2가지 형식으로 전달됨 (해당 로직은 비동기로 실행 됨)

  • APP-CXRT-
  • APP-CXRT-debug-

기존 로직에서는 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에 파일을 모두 추가하게끔 처리한다.

@zooozoo zooozoo marked this pull request as draft January 11, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant