Skip to content

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

Merged
Xuanwo merged 6 commits intoapache:mainfrom
PsiACE:improve-logging-layer
Apr 29, 2023
Merged

refactor(layers/logging): parsing level str#2160
Xuanwo merged 6 commits intoapache:mainfrom
PsiACE:improve-logging-layer

Conversation

@PsiACE
Copy link
Copy Markdown
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 <psiace@apache.org>
Signed-off-by: Chojan Shang <psiace@apache.org>
Comment thread core/src/layers/logging.rs Outdated
Signed-off-by: Chojan Shang <psiace@apache.org>
Comment thread core/src/layers/logging.rs Outdated
Signed-off-by: Chojan Shang <psiace@apache.org>
@xyjixyjixyji
Copy link
Copy Markdown
Contributor

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

@Xuanwo
Copy link
Copy Markdown
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.

Signed-off-by: Chojan Shang <psiace@apache.org>
Comment thread core/src/layers/logging.rs Outdated
Signed-off-by: Chojan Shang <psiace@apache.org>
Copy link
Copy Markdown
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