Skip to content

Commit

Permalink
chore(tracing): updated tracing msg formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Bread White committed Nov 28, 2024
1 parent d9ac2e8 commit a40ff87
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/crawler/llm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl CrawlerService for LlmCrawler {
let html_str = response.text().await?;
let html_str = match html_editor::parse(&html_str) {
Err(err) => {
tracing::error!(err=err, "failed to parse html");
tracing::error!(err = err, "failed to parse html");
html_str
}
Ok(mut dom) => dom
Expand Down
4 changes: 2 additions & 2 deletions src/feeds/rss_feeds/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ where
let art_id = response.guid();
if self.cacher().contains(art_id).await {
tracing::warn!(
article=art_id,
article = art_id,
"{topic}: news article has been already parsed"
);
continue;
Expand All @@ -143,7 +143,7 @@ where
}

tracing::info!(
article=art_id,
article = art_id,
"{topic}: article has been published successful"
);
self.cacher.set(art_id, &art).await;
Expand Down
2 changes: 1 addition & 1 deletion src/publish/pgsql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl ServiceConnect for PgsqlPublisher {
let address = config.address();

let url = format!("postgresql://{user}:{passwd}@{address}/{db}");
tracing::info!(db_url=url, "connecting to database");
tracing::info!(db_url = url, "connecting to database");
let connection = PgPoolOptions::default()
.max_connections(config.max_pool_size())
.connect(&url)
Expand Down
2 changes: 1 addition & 1 deletion src/server/routers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ where

let worker_name = form.target_url();
if let Some(worker) = workers_guard.get(worker_name) {
tracing::info!(worker=worker_name, "worker already exists");
tracing::info!(worker = worker_name, "worker already exists");
if !worker.worker().is_finished() && !form.create_force() {
let msg = format!("worker {worker_name} already launched");
return Err(ServerError::Launched(msg));
Expand Down
2 changes: 1 addition & 1 deletion src/storage/pgsql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl ServiceConnect for PgsqlTopicStorage {
let address = config.address();

let url = format!("postgresql://{user}:{passwd}@{address}/{db}");
tracing::info!(url=url, "connecting to database");
tracing::info!(url = url, "connecting to database");
let connection = PgPoolOptions::default()
.max_connections(config.max_pool_size())
.connect(&url)
Expand Down
2 changes: 1 addition & 1 deletion tests/mocks/mock_rmq_publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Publisher for MockRabbitPublisher {

async fn publish(&self, msg_body: &PublishNews) -> Result<(), Self::Error> {
let id = msg_body.id();
tracing::info!(article=id, "rabbit confirm msg successful");
tracing::info!(article = id, "rabbit confirm msg successful");
Ok(())
}
}

0 comments on commit a40ff87

Please sign in to comment.