Skip to content

feat: add martin-tracing-utils for configuring tracing (1/3) #1747

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

CommanderStorm
Copy link
Collaborator

@CommanderStorm CommanderStorm commented Mar 12, 2025

This is the first PR to break out of #1720 to make it reviewable.

The purpose is mainly to see if the added utilities are

  • read & undaerstandable
  • not magic for others and
  • not too verbose
  • and the name martin-tracing-utils okay.

Current usage of this code would be

// since logging is not yet available, we have to manually check the locations
let log_filter = LogLevel::from_argument("--log-level")
    .or_in_config_file("--config", "log_level")
    .or_env_var("MARTIN_LOG_FORMAT")
    .lossy_parse_to_filter_with_default("martin=info");
let log_format = LogFormat::from_argument("--log-level")
    .or_in_config_file("--config", "log_format")
    .or_env_var("RUST_LOG")
    .or_default(LogFormatOptions::Compact);
MartinObservability::from((log_filter, log_format))
    .with_initialised_log_tracing()
    .set_global_subscriber();

@CommanderStorm CommanderStorm requested a review from nyurik March 25, 2025 02:08
Copilot

This comment was marked as resolved.

@sharkAndshark sharkAndshark requested a review from Copilot May 6, 2025 02:45
Copilot

This comment was marked as resolved.

@CommanderStorm
Copy link
Collaborator Author

CommanderStorm commented May 10, 2025

@nyurik @sharkAndshark might it be possible to get an review on this one? 👉🏻👈🏻

This would really help me push towards #1720 which (for me) currently kind of blocks the refactoring #1805 (comment)

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.

1 participant