From ecea7f384781c37b84ecb4e92f476353b4248ade Mon Sep 17 00:00:00 2001 From: erhant Date: Wed, 4 Dec 2024 14:19:17 +0300 Subject: [PATCH] small log fixes --- .env.example | 3 +-- Makefile | 1 - compute/src/main.rs | 9 ++++++--- p2p/src/client.rs | 4 ++-- workflows/src/apis/jina.rs | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 2643565..dc06a2d 100644 --- a/.env.example +++ b/.env.example @@ -32,8 +32,7 @@ GEMINI_API_KEY= OPENROUTER_API_KEY= ## Ollama (if used, optional) ## -# do not change this, it is used by Docker -OLLAMA_HOST=http://host.docker.internal +OLLAMA_HOST=http://localhost # you can change the port if you would like OLLAMA_PORT=11434 # if "true", automatically pull models from Ollama diff --git a/Makefile b/Makefile index 95605df..2881fe3 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,6 @@ endif ############################################################################### .PHONY: launch # | Run with INFO logs in release mode launch: - RUST_LOG=none,dkn_compute=info,dkn_workflows=info,dkn_p2p=info \ cargo run --release --bin dkn-compute .PHONY: run # | Run with INFO logs diff --git a/compute/src/main.rs b/compute/src/main.rs index 8314b05..c90483b 100644 --- a/compute/src/main.rs +++ b/compute/src/main.rs @@ -16,9 +16,6 @@ async fn main() -> Result<()> { .filter_module("dkn_workflows", log::LevelFilter::Info) .parse_default_env() // reads RUST_LOG variable .init(); - if let Err(e) = dotenv_result { - log::warn!("could not load .env file: {}", e); - } log::info!( r#" @@ -32,6 +29,12 @@ async fn main() -> Result<()> { "# ); + // log about env usage + match dotenv_result { + Ok(path) => log::info!("Loaded .env file at: {}", path.display()), + Err(e) => log::warn!("Could not load .env file: {}", e), + } + // task tracker for multiple threads let task_tracker = TaskTracker::new(); let cancellation = CancellationToken::new(); diff --git a/p2p/src/client.rs b/p2p/src/client.rs index f54d222..7d0c0ee 100644 --- a/p2p/src/client.rs +++ b/p2p/src/client.rs @@ -17,11 +17,11 @@ use super::DriaP2PCommander; /// Peer-to-peer client for Dria Knowledge Network. pub struct DriaP2PClient { - /// `Swarm` instance, everything is accesses through this one. + /// `Swarm` instance, everything p2p-related are accessed through this instace. swarm: Swarm, /// Dria protocol, used for identifying the client. protocol: DriaP2PProtocol, - /// Message sender / transmitter. + /// Gossipsub message sender. msg_tx: mpsc::Sender<(PeerId, MessageId, Message)>, /// Command receiver. cmd_rx: mpsc::Receiver, diff --git a/workflows/src/apis/jina.rs b/workflows/src/apis/jina.rs index 2949026..1ecdac5 100644 --- a/workflows/src/apis/jina.rs +++ b/workflows/src/apis/jina.rs @@ -41,7 +41,7 @@ impl JinaConfig { log::info!("Jina API key not found, skipping"); return Ok(()); }; - log::info!("Jina API key found {api_key}, checking service"); + log::info!("Jina API key found, checking service"); // make a dummy request to "example.com" let client = Client::new();