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

refactor(layers/logging): parsing level str #2160

Merged
merged 6 commits into from
Apr 29, 2023

Conversation

PsiACE
Copy link
Member

@PsiACE PsiACE commented Apr 28, 2023

Attempt to parse str as level and parse level must succeed.

fixes: #2090

Signed-off-by: Chojan Shang <[email protected]>
core/src/layers/logging.rs Outdated Show resolved Hide resolved
core/src/layers/logging.rs Outdated Show resolved Hide resolved
@xyjixyjixyji
Copy link
Contributor

I think we can directly return Self instead of Result<Self> since any error happens here will lead to panic.

@Xuanwo
Copy link
Member

Xuanwo commented Apr 29, 2023

I think we can directly return Self instead of Result<Self> since any error happens here will lead to panic.

We should not panic here. It's possible that users can input invalid values like Haha. We should return an error instead.

core/src/layers/logging.rs Outdated Show resolved Hide resolved
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Thanks!

@Xuanwo Xuanwo merged commit 4aa5474 into apache:main Apr 29, 2023
@Xuanwo Xuanwo mentioned this pull request May 6, 2023
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.

Improve the LoggingLayer API
3 participants