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

Log #627

Merged
merged 2 commits into from
Nov 30, 2023
Merged

Log #627

merged 2 commits into from
Nov 30, 2023

Conversation

yuyang0
Copy link
Contributor

@yuyang0 yuyang0 commented Nov 30, 2023

  1. update plugin cache
  2. support file log

log/log.go Outdated
MaxAge: cfg.MaxAge, // days
}
} else { //nolint
if !cfg.UseJSON {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switch {
case cfg.Filename != "":
   ...
case !cfg.UseJSON:
  ...
default:
  writer = os.Stdout
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方我想弄得逻辑是如果是文件那就一直json,往stdout写的时候才区分是否用json,所以我才搞了个if else,连else if都没用,当然要用switch搞也行

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

恩我理解,就是 else 断行 if 不清真……用 switch 吧

@CMGS CMGS merged commit 4066bf7 into projecteru2:master Nov 30, 2023
3 checks passed
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.

2 participants