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

Fix InitLogger just no work #759

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

dingyang666
Copy link
Contributor

@dingyang666 dingyang666 commented Jun 6, 2024

#722 这个 pr 导致 InitLogger 无法工作,原因是 init 创建了一个 logger 导致 InitLogger 中的 if logger != nil 永远是 true,见 #747

碰巧 init 中创建的 logger 是 debug 级别,会在线上输出大量日志,更新后日志相关成本激增
image

改用 sync.Once 保证只创建一次,在 InitLogger 不失效的同时,满足 #722 老哥大量创建和销毁客户端的奇怪需求

@CLAassistant
Copy link

CLAassistant commented Jun 6, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@binbin0325 binbin0325 left a comment

Choose a reason for hiding this comment

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

建议直接去掉 logger != nil 的逻辑,这里应该允许重复创建logger, 大量创建使用不当,不应该在sdk的考虑范围内

@dingyang666
Copy link
Contributor Author

建议直接去掉 logger != nil 的逻辑,这里应该允许重复创建logger, 大量创建使用不当,不应该在sdk的考虑范围内

done

@yesAnd92 yesAnd92 mentioned this pull request Jun 12, 2024
Copy link
Member

@binbin0325 binbin0325 left a comment

Choose a reason for hiding this comment

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

LGTM

@binbin0325 binbin0325 merged commit b2c297e into nacos-group:master Jun 13, 2024
1 of 2 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.

3 participants