Skip to content

Commit

Permalink
Merge pull request #166 from LeoniePhiline/renovate/clap-verbosity-fl…
Browse files Browse the repository at this point in the history
…ag-3.x

fix(deps): update rust crate clap-verbosity-flag to v3
  • Loading branch information
LeoniePhiline authored Nov 21, 2024
2 parents 325adfd + e368050 commit 5c80e32
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 32 deletions.
7 changes: 3 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ publish = false

[dependencies]
clap = { version = "4.5.4", features = ["derive", "wrap_help"] }
clap-verbosity-flag = "2.2.0"
clap-verbosity-flag = { version = "3.0.0", default-features = false, features = ["tracing"] }
color-eyre = "0.6.3"
crossterm = { version = "0.28.0", features = ["event-stream"] }
futures = "0.3.30"
htmlize = { version = "1.0.5", features = ["unescape"] }
json_dotpath = "1.1.0"
log = "0.4.21"
nix = { version = "0.29.0", features = ["process", "signal"] }
once_cell = "1.19.0"
opentelemetry = "0.23"
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#![deny(
// fuzzy_provenance_casts, UNSTABLE: https://github.com/rust-lang/rust/issues/95228
// lossy_provenance_casts, UNSTABLE: https://github.com/rust-lang/rust/issues/95228
pointer_structural_match,
unsafe_code // Exceptions must be discussed and deemed indispensable and use `#![deny(invalid_reference_casting, unsafe_op_in_unsafe_fn)]`.
)]
// Opt-in to allowed-by-default clippy lints
Expand Down
26 changes: 2 additions & 24 deletions src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use opentelemetry::KeyValue;
use opentelemetry_sdk::Resource;
use tracing_appender::non_blocking::WorkerGuard;
use tracing_error::ErrorLayer;
use tracing_subscriber::{filter::Directive, layer::SubscriberExt};
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::{prelude::*, EnvFilter};

use crate::args::Args;
Expand Down Expand Up @@ -56,28 +56,6 @@ fn env_filter(verbosity: &Verbosity) -> EnvFilter {
// or use `RUST_LOG=target[span{field=value}]=level` for fine-grained verbosity control.
// See https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html
tracing_subscriber::EnvFilter::builder()
.with_default_directive(
LogLevel::from(&verbosity.log_level().unwrap_or(log::Level::Error)).into_directive(),
)
.with_default_directive(verbosity.tracing_level_filter().into())
.from_env_lossy()
}

pub(crate) struct LogLevel(tracing::Level);

impl From<&log::Level> for LogLevel {
fn from(log_level: &log::Level) -> Self {
LogLevel(match log_level {
log::Level::Error => tracing::Level::ERROR,
log::Level::Warn => tracing::Level::WARN,
log::Level::Info => tracing::Level::INFO,
log::Level::Debug => tracing::Level::DEBUG,
log::Level::Trace => tracing::Level::TRACE,
})
}
}

impl LogLevel {
pub(crate) fn into_directive(self) -> Directive {
self.0.into()
}
}
2 changes: 1 addition & 1 deletion src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl Ui {
let all_videos_read = Self::acquire_all_videos_sorted(all_videos.iter()).await;

terminal.draw(|frame| {
let area = frame.size();
let area = frame.area();

let chunks = layout::layout_chunks(area, &all_videos_read);

Expand Down

0 comments on commit 5c80e32

Please sign in to comment.