diff --git a/CHANGELOG.md b/CHANGELOG.md index 78476be..690e816 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,27 +4,31 @@ All notable changes to this project will be documented in this file. ## [0.0.6] - 2024-11-10 ### Added -- Adding max-tokens argument +- Adding max-tokens argument. + +### Fixed +- Code was flushing last line data; +- Replacing env_logger with simple_logger (atty sec bug). ## [0.0.5] - 2024-10-06 ### Added -- Adding auto-jql +- Adding auto-jql. ## [0.0.4] - 2024-10-02 ### Performance -- Improved performance by implementing async batches processing +- Improved performance by implementing async batches processing. ## [0.0.3] - 2024-10-01 ### Changed -- Migrated from Cody API v1 to v2 +- Migrated from Cody API v1 to v2. ## [0.0.2] - 2024-09-30 ### Added -- Extra options +- Extra options. ### Fixed -- Various bug fixes +- Various bug fixes. ## [0.0.1] - 2024-09-29 ### Added -- Initial release +- Initial release. diff --git a/Cargo.lock b/Cargo.lock index 48ec008..70e6b97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,12 +40,12 @@ name = "askJira" version = "0.0.6" dependencies = [ "base64 0.13.1", - "env_logger", "futures", "indicatif", "log", "reqwest", "serde_json", + "simple_logger", "structopt", "tokio", ] @@ -148,6 +148,16 @@ dependencies = [ "vec_map", ] +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + [[package]] name = "console" version = "0.15.8" @@ -176,6 +186,15 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "encode_unicode" version = "0.3.6" @@ -191,19 +210,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "env_logger" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -434,12 +440,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyper" version = "0.14.30" @@ -614,6 +614,21 @@ dependencies = [ "tempfile", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + [[package]] name = "number_prefix" version = "0.4.0" @@ -726,6 +741,12 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -979,6 +1000,18 @@ dependencies = [ "libc", ] +[[package]] +name = "simple_logger" +version = "4.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7e46c8c90251d47d08b28b8a419ffb4aede0f87c2eea95e17d1d5bacbf3ef1" +dependencies = [ + "colored", + "log", + "time", + "windows-sys 0.48.0", +] + [[package]] name = "slab" version = "0.4.9" @@ -1097,21 +1130,45 @@ dependencies = [ ] [[package]] -name = "termcolor" -version = "1.4.1" +name = "textwrap" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "winapi-util", + "unicode-width", ] [[package]] -name = "textwrap" -version = "0.11.0" +name = "time" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ - "unicode-width", + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", ] [[package]] @@ -1395,15 +1452,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index e45ac13..63211db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ authors = ["kiraum "] [dependencies] base64 = "0.13.0" -env_logger = "0.9" +simple_logger = "4.3.0" futures = "0.3.28" indicatif = "0.16" log = "0.4" diff --git a/README.md b/README.md index 6f967bb..a4f6209 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ cargo run -- --message "Your question here" --jql "project = PROJ and created > Additional options: - `--max-issues`: Maximum number of issues to fetch (default: 100000) - `--max-results`: Maximum number of results per Jira API call (default: 100) -- ` --max-tokens`: Maximum number of tokens in the response [default: 2000] +- `--max-tokens`: Maximum number of tokens in the response [default: 2000] - `--debug`: Enable debug mode - `--list-models`: List available models - `--set-model`: Set the model to use diff --git a/bin/macos-arm64/askJira b/bin/macos-arm64/askJira index b13d78d..d1ea4fd 100755 Binary files a/bin/macos-arm64/askJira and b/bin/macos-arm64/askJira differ diff --git a/releases/v0.0.6/askJira-v0.0.6-macos-arm64.tar.gz b/releases/v0.0.6/askJira-v0.0.6-macos-arm64.tar.gz index d065c8e..0354cca 100644 Binary files a/releases/v0.0.6/askJira-v0.0.6-macos-arm64.tar.gz and b/releases/v0.0.6/askJira-v0.0.6-macos-arm64.tar.gz differ diff --git a/src/main.rs b/src/main.rs index 620174d..d07051e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,3 @@ -use env_logger::Env; use futures::future::join_all; use indicatif::{ProgressBar, ProgressStyle}; use log::{debug, warn}; @@ -76,12 +75,11 @@ async fn main() -> Result<(), Box> { let opt = Opt::from_args(); // Set up logging based on debug flag - let env = if opt.debug { - Env::default().filter_or("RUST_LOG", "debug") + if opt.debug { + simple_logger::init_with_level(log::Level::Debug).unwrap(); } else { - Env::default().filter_or("RUST_LOG", "info") - }; - env_logger::init_from_env(env); + simple_logger::init_with_level(log::Level::Info).unwrap(); + } debug!( "Command line arguments: {:?}",