From a9968243c73ac88a5f06b3a16f0a61aa3e4cf0be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Urban?= Date: Thu, 16 May 2024 12:03:44 +0200 Subject: [PATCH] fix(application): improve logging, add correct version to Cargo.toml --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/llm_api.rs | 2 +- src/main.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2afaf9b..1f5a4d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -158,7 +158,7 @@ dependencies = [ [[package]] name = "doclytics" -version = "0.1.0" +version = "1.1.4-rc.9" dependencies = [ "lazy_static", "ollama-rs", diff --git a/Cargo.toml b/Cargo.toml index 7ae6171..b7ea7b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "doclytics" -version = "0.1.0" +version = "1.1.4-rc.9" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/llm_api.rs b/src/llm_api.rs index 8d0d643..d76d9c4 100644 --- a/src/llm_api.rs +++ b/src/llm_api.rs @@ -15,7 +15,7 @@ pub async fn generate_response( .await; match res { Ok(res) => { - slog_scope::debug!("Response from ollama {}", res.response); + slog_scope::debug!("Response from ollama:\n {}", res.response); Ok(res) }, Err(e) => { diff --git a/src/main.rs b/src/main.rs index c143e00..4f1256e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -142,7 +142,7 @@ async fn process_documents(client: &Client, ollama: &Ollama, model: &str, base_u #[tokio::main] async fn main() -> Result<(), Box> { logger::init(); // Initializes the global logger - slog_scope::info!("Application started {}", "!"); + slog_scope::info!("Application started, version: {}", env!("CARGO_PKG_VERSION")); let token = env::var("PAPERLESS_TOKEN").expect("PAPERLESS_TOKEN is not set in .env file"); let base_url = env::var("PAPERLESS_BASE_URL").expect("PAPERLESS_BASE_URL is not set in .env file"); let client = init_paperless_client(&token);