Skip to content

Add min_log_level config #43

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

Merged
merged 2 commits into from
Apr 28, 2025
Merged

Add min_log_level config #43

merged 2 commits into from
Apr 28, 2025

Conversation

hramezani
Copy link
Member

No description provided.

@hramezani hramezani force-pushed the min-log-level-config branch 6 times, most recently from 8af111f to 309500d Compare April 25, 2025 07:44
@codecov-commenter
Copy link

codecov-commenter commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 98.70130% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/internal/exporters/console.rs 98.43% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@hramezani hramezani requested a review from davidhewitt April 25, 2025 07:47
Copy link
Contributor

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks, just a small suggestion!

if let Some(level) = level {
// Filter out span below the minimum log level
if level < level_to_level_number(self.options.min_log_level) {
return Ok(());
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be worth reordering this to avoid the option check, something like

if let Value::I64(level_num) = kv.value {
    if level_num < level_to_level_number(self.options.min_log_level) {
        return Ok(());
    }
    level = Some(level_num);
}

and similar below in otel_data_to_writer.

@hramezani hramezani force-pushed the min-log-level-config branch 2 times, most recently from 0614204 to 2285fa0 Compare April 28, 2025 14:15
@hramezani hramezani force-pushed the min-log-level-config branch from 2285fa0 to 7e605ee Compare April 28, 2025 14:18
@hramezani hramezani requested a review from davidhewitt April 28, 2025 14:20
Copy link
Contributor

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks!

@davidhewitt davidhewitt merged commit f84e5a7 into main Apr 28, 2025
7 checks passed
@davidhewitt davidhewitt deleted the min-log-level-config branch April 28, 2025 14:21
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