From b4fd4212ad9109ec42d22e72b8795e03b23b6250 Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 23 Jun 2021 10:41:55 +0200 Subject: [PATCH] reduce the log level of some info! --- meilisearch-http/src/index/updates.rs | 8 ++++---- meilisearch-http/src/index_controller/dump_actor/actor.rs | 6 +++--- meilisearch-http/src/index_controller/dump_actor/mod.rs | 4 ++-- meilisearch-http/src/index_controller/snapshot.rs | 8 ++++---- .../src/index_controller/update_actor/actor.rs | 4 ++-- .../src/index_controller/uuid_resolver/actor.rs | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/meilisearch-http/src/index/updates.rs b/meilisearch-http/src/index/updates.rs index 6ace7e375..09535721f 100644 --- a/meilisearch-http/src/index/updates.rs +++ b/meilisearch-http/src/index/updates.rs @@ -4,7 +4,7 @@ use std::marker::PhantomData; use std::num::NonZeroUsize; use flate2::read::GzDecoder; -use log::info; +use log::{debug, info, trace}; use milli::update::{IndexDocumentsMethod, UpdateBuilder, UpdateFormat}; use serde::{Deserialize, Serialize, Serializer}; @@ -201,7 +201,7 @@ impl Index { update_builder: UpdateBuilder, primary_key: Option<&str>, ) -> Result { - info!("performing document addition"); + trace!("performing document addition"); // Set the primary key if not set already, ignore if already set. if let (None, Some(primary_key)) = (self.primary_key(txn)?, primary_key) { @@ -215,7 +215,7 @@ impl Index { builder.index_documents_method(method); let indexing_callback = - |indexing_step, update_id| info!("update {}: {:?}", update_id, indexing_step); + |indexing_step, update_id| debug!("update {}: {:?}", update_id, indexing_step); let gzipped = false; let addition = match content { @@ -300,7 +300,7 @@ impl Index { } builder.execute(|indexing_step, update_id| { - info!("update {}: {:?}", update_id, indexing_step) + debug!("update {}: {:?}", update_id, indexing_step) })?; Ok(UpdateResult::Other) diff --git a/meilisearch-http/src/index_controller/dump_actor/actor.rs b/meilisearch-http/src/index_controller/dump_actor/actor.rs index 4924df947..eee733c4a 100644 --- a/meilisearch-http/src/index_controller/dump_actor/actor.rs +++ b/meilisearch-http/src/index_controller/dump_actor/actor.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use async_stream::stream; use chrono::Utc; use futures::{lock::Mutex, stream::StreamExt}; -use log::{error, info}; +use log::{error, trace}; use tokio::sync::{mpsc, oneshot, RwLock}; use update_actor::UpdateActorHandle; use uuid_resolver::UuidResolverHandle; @@ -60,7 +60,7 @@ where } pub async fn run(mut self) { - info!("Started dump actor."); + trace!("Started dump actor."); let mut inbox = self .inbox @@ -135,7 +135,7 @@ where match task_result { Ok(Ok(())) => { dump_infos.done(); - info!("Dump succeed"); + trace!("Dump succeed"); } Ok(Err(e)) => { dump_infos.with_error(e.to_string()); diff --git a/meilisearch-http/src/index_controller/dump_actor/mod.rs b/meilisearch-http/src/index_controller/dump_actor/mod.rs index 057b8ebaf..a73740b02 100644 --- a/meilisearch-http/src/index_controller/dump_actor/mod.rs +++ b/meilisearch-http/src/index_controller/dump_actor/mod.rs @@ -3,7 +3,7 @@ use std::path::{Path, PathBuf}; use anyhow::Context; use chrono::{DateTime, Utc}; -use log::{info, warn}; +use log::{info, trace, warn}; #[cfg(test)] use mockall::automock; use serde::{Deserialize, Serialize}; @@ -164,7 +164,7 @@ where P: UpdateActorHandle + Send + Sync + Clone + 'static, { async fn run(self) -> Result<()> { - info!("Performing dump."); + trace!("Performing dump."); create_dir_all(&self.path).await?; diff --git a/meilisearch-http/src/index_controller/snapshot.rs b/meilisearch-http/src/index_controller/snapshot.rs index 9f0c5c0ba..7bdedae76 100644 --- a/meilisearch-http/src/index_controller/snapshot.rs +++ b/meilisearch-http/src/index_controller/snapshot.rs @@ -2,7 +2,7 @@ use std::path::{Path, PathBuf}; use std::time::Duration; use anyhow::bail; -use log::{error, info}; +use log::{error, info, trace}; use tokio::fs; use tokio::task::spawn_blocking; use tokio::time::sleep; @@ -47,14 +47,14 @@ where ); loop { if let Err(e) = self.perform_snapshot().await { - error!("{}", e); + error!("Error while performing snapshot: {}", e); } sleep(self.snapshot_period).await; } } async fn perform_snapshot(&self) -> anyhow::Result<()> { - info!("Performing snapshot."); + trace!("Performing snapshot."); let snapshot_dir = self.snapshot_path.clone(); fs::create_dir_all(&snapshot_dir).await?; @@ -87,7 +87,7 @@ where }) .await??; - info!("Created snapshot in {:?}.", snapshot_path); + trace!("Created snapshot in {:?}.", snapshot_path); Ok(()) } diff --git a/meilisearch-http/src/index_controller/update_actor/actor.rs b/meilisearch-http/src/index_controller/update_actor/actor.rs index 5bc2c727e..51e8cb28c 100644 --- a/meilisearch-http/src/index_controller/update_actor/actor.rs +++ b/meilisearch-http/src/index_controller/update_actor/actor.rs @@ -6,7 +6,7 @@ use std::sync::Arc; use async_stream::stream; use futures::StreamExt; -use log::info; +use log::{trace}; use oxidized_json_checker::JsonChecker; use tokio::fs; use tokio::io::AsyncWriteExt; @@ -61,7 +61,7 @@ where pub async fn run(mut self) { use UpdateMsg::*; - info!("Started update actor."); + trace!("Started update actor."); let mut inbox = self .inbox diff --git a/meilisearch-http/src/index_controller/uuid_resolver/actor.rs b/meilisearch-http/src/index_controller/uuid_resolver/actor.rs index efad15c92..d221bd4f2 100644 --- a/meilisearch-http/src/index_controller/uuid_resolver/actor.rs +++ b/meilisearch-http/src/index_controller/uuid_resolver/actor.rs @@ -1,6 +1,6 @@ use std::{collections::HashSet, path::PathBuf}; -use log::{info, warn}; +use log::{trace, warn}; use tokio::sync::mpsc; use uuid::Uuid; @@ -19,7 +19,7 @@ impl UuidResolverActor { pub async fn run(mut self) { use UuidResolveMsg::*; - info!("uuid resolver started"); + trace!("uuid resolver started"); loop { match self.inbox.recv().await {