diff --git a/.zetch.lock b/.zetch.lock index 8ce8bbc6..d7615dc5 100644 --- a/.zetch.lock +++ b/.zetch.lock @@ -1,23 +1,24 @@ { "version": "0.0.10", "files": { - "rust/LICENSE.zetch.md": "d2c12e539d357957b950a54a5477c3a9f87bd2b3ee707be7a4db7adaf5aacc2b", "js/LICENSE.zetch.md": "d2c12e539d357957b950a54a5477c3a9f87bd2b3ee707be7a4db7adaf5aacc2b", - "py_rust/README.zetch.md": "e0cd5a8e29b788cc787becd1b2882cc735558a12b63b6e74f4ce69f0bb1f2188", - "py_rust/LICENSE.zetch.md": "d2c12e539d357957b950a54a5477c3a9f87bd2b3ee707be7a4db7adaf5aacc2b", - "CONTRIBUTING.zetch.md": "bace46dc064746b54cf472eba960d934d705c2f83120b865a4b47032ff1552c5", - "py/README.zetch.md": "e0cd5a8e29b788cc787becd1b2882cc735558a12b63b6e74f4ce69f0bb1f2188", - "opencollector.yaml.zetch": "678a691ae64d7f9893e8799ea657842fe051b3fcce4da568969d8de070a29393", - "docs/CONTRIBUTING.zetch.md": "bace46dc064746b54cf472eba960d934d705c2f83120b865a4b47032ff1552c5", - "js/tsconfig.zetch.json": "fb5d57b825bb3c2f6dd4254bf939f2444e52946622a7f93b91e3acb75876ebbc", + "README.zetch.md": "be6ab7e03e141946131c589b3ac1df2e55d2b8bb53757499469738037e06077b", "docs/LICENSE.zetch.md": "d2c12e539d357957b950a54a5477c3a9f87bd2b3ee707be7a4db7adaf5aacc2b", - "py/LICENSE.zetch.md": "d2c12e539d357957b950a54a5477c3a9f87bd2b3ee707be7a4db7adaf5aacc2b", "js/README.zetch.md": "e0cd5a8e29b788cc787becd1b2882cc735558a12b63b6e74f4ce69f0bb1f2188", - "docs/CODE_OF_CONDUCT.zetch.md": "bf106326ffc75f5167cfde27c997c77c6b97c843a9e392b564355d0e70e50b97", + "CODE_OF_CONDUCT.zetch.md": "bf106326ffc75f5167cfde27c997c77c6b97c843a9e392b564355d0e70e50b97", + "rust/LICENSE.zetch.md": "d2c12e539d357957b950a54a5477c3a9f87bd2b3ee707be7a4db7adaf5aacc2b", "rust/README.zetch.md": "e0cd5a8e29b788cc787becd1b2882cc735558a12b63b6e74f4ce69f0bb1f2188", + "py/README.zetch.md": "e0cd5a8e29b788cc787becd1b2882cc735558a12b63b6e74f4ce69f0bb1f2188", + "CONTRIBUTING.zetch.md": "bace46dc064746b54cf472eba960d934d705c2f83120b865a4b47032ff1552c5", + "opencollector.yaml.zetch": "33aa6a1e9e386b9e01c3d4c010b70260654c06850fb1433afb15545bd85f2f2d", + "py_rust/LICENSE.zetch.md": "d2c12e539d357957b950a54a5477c3a9f87bd2b3ee707be7a4db7adaf5aacc2b", "LICENSE.zetch.md": "d2c12e539d357957b950a54a5477c3a9f87bd2b3ee707be7a4db7adaf5aacc2b", - "CODE_OF_CONDUCT.zetch.md": "bf106326ffc75f5167cfde27c997c77c6b97c843a9e392b564355d0e70e50b97", - "README.zetch.md": "be6ab7e03e141946131c589b3ac1df2e55d2b8bb53757499469738037e06077b", - "docs/index.zetch.md": "e0cd5a8e29b788cc787becd1b2882cc735558a12b63b6e74f4ce69f0bb1f2188" + "docs/CODE_OF_CONDUCT.zetch.md": "bf106326ffc75f5167cfde27c997c77c6b97c843a9e392b564355d0e70e50b97", + "docs/index.zetch.md": "e0cd5a8e29b788cc787becd1b2882cc735558a12b63b6e74f4ce69f0bb1f2188", + "py_rust/README.zetch.md": "e0cd5a8e29b788cc787becd1b2882cc735558a12b63b6e74f4ce69f0bb1f2188", + "js/tsconfig.zetch.json": "fb5d57b825bb3c2f6dd4254bf939f2444e52946622a7f93b91e3acb75876ebbc", + "py/LICENSE.zetch.md": "d2c12e539d357957b950a54a5477c3a9f87bd2b3ee707be7a4db7adaf5aacc2b", + "rust/pkg/LICENSE.zetch.md": "d2c12e539d357957b950a54a5477c3a9f87bd2b3ee707be7a4db7adaf5aacc2b", + "docs/CONTRIBUTING.zetch.md": "bace46dc064746b54cf472eba960d934d705c2f83120b865a4b47032ff1552c5" } } \ No newline at end of file diff --git a/js/bitbazaar/color/steppedScale.ts b/js/bitbazaar/color/steppedScale.ts index 7d3f560c..ed3fa95e 100644 --- a/js/bitbazaar/color/steppedScale.ts +++ b/js/bitbazaar/color/steppedScale.ts @@ -34,6 +34,9 @@ export const createSteppedScale = ({ // Try up to 5 times to produce values that don't end in white or black (i.e. the step size too large) const numAttempts = 5; for (let attempt = 1; attempt <= numAttempts; attempt++) { + // Reset steps for new attempt: + steps.length = 0; + // Reduce the step size each attempt, to try and get a scale that doesn't hit white or black: const stepSize = 0.5 * (1 / attempt); let failed = false; @@ -61,9 +64,6 @@ export const createSteppedScale = ({ if (!failed) { break; } - - // Reset steps to try again: - steps.length = 0; } return steps; diff --git a/opencollector.yaml b/opencollector.yaml index 2024bff1..7ee2e638 100644 --- a/opencollector.yaml +++ b/opencollector.yaml @@ -32,7 +32,7 @@ exporters: stream-name: default # Writes all opentelemetry logs, traces, metrics to a file, useful for testing: file/debug_file_writing: - path: /home/runner/work/bitbazaar/bitbazaar/logs/otlp_telemetry_out.log + path: /Users/zak/z/code/bitbazaar/logs/otlp_telemetry_out.log rotation: max_megabytes: 10 max_days: 3 diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 2e479715..ae8e8683 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -41,54 +41,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" - -[[package]] -name = "anstyle-parse" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - [[package]] name = "anyhow" version = "1.0.79" @@ -198,7 +150,6 @@ name = "bitbazaar" version = "0.0.38" dependencies = [ "chrono", - "clap", "colored", "comfy-table", "conch-parser", @@ -292,52 +243,6 @@ dependencies = [ "windows-targets 0.52.0", ] -[[package]] -name = "clap" -version = "4.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.49", -] - -[[package]] -name = "clap_lex" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" - -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - [[package]] name = "colored" version = "2.1.0" @@ -1794,12 +1699,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "strsim" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" - [[package]] name = "strum" version = "0.25.0" @@ -2243,12 +2142,6 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - [[package]] name = "uuid" version = "1.7.0" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 40424784..dc76988e 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -21,7 +21,6 @@ all-features = true [features] log-filter = ["dep:regex"] -clap = ["dep:clap"] timing = ['dep:comfy-table', 'dep:chrono'] cli = ['dep:normpath', 'dep:conch-parser', 'dep:homedir', 'dep:chrono', 'dep:strum'] redis = ['dep:deadpool-redis', 'dep:redis', 'dep:sha1_smol', 'dep:serde_json'] @@ -70,9 +69,6 @@ serde_json = { version = "1.0", optional = true } # FEAT: log-filter: regex = { version = '1', optional = true } -# FEAT: clap: -clap = { version = "4.4", features = ["derive", "string"], optional = true } - # FEAT: timing: comfy-table = { version = "7.1", optional = true } diff --git a/rust/bitbazaar/log/clap_log_level_args.rs b/rust/bitbazaar/log/clap_log_level_args.rs deleted file mode 100644 index 28897cfa..00000000 --- a/rust/bitbazaar/log/clap_log_level_args.rs +++ /dev/null @@ -1,45 +0,0 @@ -use tracing::Level; - -/// A simple clap argument group for controlling the log level for cli usage. -#[derive(Debug, clap::Args)] -pub struct ClapLogLevelArgs { - /// Enable verbose logging. - #[arg( - short, - long, - global = true, - group = "verbosity", - help_heading = "Log levels" - )] - pub verbose: bool, - /// Print diagnostics, but nothing else. - #[arg( - short, - long, - global = true, - group = "verbosity", - help_heading = "Log levels" - )] - /// Disable all logging (but still exit with status code "1" upon detecting diagnostics). - #[arg( - short, - long, - global = true, - group = "verbosity", - help_heading = "Log levels" - )] - pub silent: bool, -} - -impl ClapLogLevelArgs { - /// Convert the clap log level argument group into a log level that can be passed to `create_subscriber`. Will be None when Silent - pub fn level(&self) -> Option { - if self.silent { - None - } else if self.verbose { - Some(Level::TRACE) - } else { - Some(Level::INFO) - } - } -} diff --git a/rust/bitbazaar/log/mod.rs b/rust/bitbazaar/log/mod.rs index 7f6579a5..94d10896 100644 --- a/rust/bitbazaar/log/mod.rs +++ b/rust/bitbazaar/log/mod.rs @@ -1,5 +1,3 @@ -#[cfg(feature = "clap")] -mod clap_log_level_args; #[cfg(test)] mod diff_file_log; mod global_log; @@ -7,8 +5,6 @@ mod macros; #[cfg(any(feature = "opentelemetry-grpc", feature = "opentelemetry-http"))] mod ot_tracing_bridge; -#[cfg(feature = "clap")] -pub use clap_log_level_args::ClapLogLevelArgs; pub use global_log::{global_fns::*, GlobalLog, GlobalLogBuilder}; #[cfg(test)]